2002-01-26 11:38:28 -05:00
|
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
|
|
|
2004-03-04 09:41:28 -05:00
|
|
|
<!--
|
|
|
|
Copyright 1999-2004 The Apache Software Foundation
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
-->
|
|
|
|
|
|
|
|
|
2002-01-26 11:38:28 -05:00
|
|
|
<!-- Content Stylesheet for Site -->
|
|
|
|
|
|
|
|
|
|
|
|
<!-- start the processing -->
|
|
|
|
<!-- ====================================================================== -->
|
2002-12-12 01:23:48 -05:00
|
|
|
<!-- GENERATED FILE, DO NOT EDIT, EDIT THE XML FILE IN xdocs INSTEAD! -->
|
2002-01-26 11:38:28 -05:00
|
|
|
<!-- Main Page Section -->
|
|
|
|
<!-- ====================================================================== -->
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
|
|
|
|
|
|
|
|
<meta name="author" value="Andrew C. Oliver">
|
|
|
|
<meta name="email" value="acoliver@apache.org">
|
|
|
|
|
2002-02-09 07:39:16 -05:00
|
|
|
|
|
|
|
|
2003-01-04 11:29:08 -05:00
|
|
|
|
2005-02-14 11:48:47 -05:00
|
|
|
<title>Apache Lucene - Apache Lucene - Building and Installing the Basic Demo</title>
|
2006-08-22 09:38:16 -04:00
|
|
|
<link rel="stylesheet" type="text/css" href="styles/lucene.css">
|
2002-01-26 11:38:28 -05:00
|
|
|
</head>
|
|
|
|
|
|
|
|
<body bgcolor="#ffffff" text="#000000" link="#525D76">
|
|
|
|
<table border="0" width="100%" cellspacing="0">
|
|
|
|
<!-- TOP IMAGE -->
|
|
|
|
<tr>
|
|
|
|
<td align="left">
|
2005-05-02 14:50:45 -04:00
|
|
|
<a href="http://www.apache.org"><img src="http://lucene.apache.org/java/docs/images/asf-logo.gif" width="387" height="100" border="0"/></a>
|
2002-01-26 11:38:28 -05:00
|
|
|
</td>
|
|
|
|
<td align="right">
|
2005-02-14 11:48:47 -05:00
|
|
|
<a href="http://lucene.apache.org/"><img src="./images/lucene_green_300.gif" alt="Apache Lucene" border="0"/></a>
|
2002-01-26 11:38:28 -05:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<table border="0" width="100%" cellspacing="4">
|
|
|
|
<tr><td colspan="2">
|
|
|
|
<hr noshade="" size="1"/>
|
|
|
|
</td></tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<!-- LEFT SIDE NAVIGATION -->
|
|
|
|
<td width="20%" valign="top" nowrap="true">
|
2003-10-09 10:40:30 -04:00
|
|
|
|
|
|
|
<!-- ============================================================ -->
|
|
|
|
|
|
|
|
<p><strong>About</strong></p>
|
2002-01-26 11:38:28 -05:00
|
|
|
<ul>
|
|
|
|
<li> <a href="./index.html">Overview</a>
|
2005-05-14 19:05:04 -04:00
|
|
|
</li>
|
|
|
|
<li> <a href="./features.html">Features</a>
|
2002-01-26 11:38:28 -05:00
|
|
|
</li>
|
2004-05-18 09:32:01 -04:00
|
|
|
<li> <a href="http://wiki.apache.org/jakarta-lucene/PoweredBy">Powered by Lucene</a>
|
2002-01-26 11:38:28 -05:00
|
|
|
</li>
|
|
|
|
<li> <a href="./whoweare.html">Who We Are</a>
|
|
|
|
</li>
|
2005-03-26 07:58:35 -05:00
|
|
|
<li> <a href="./mailinglists.html">Mailing Lists</a>
|
2002-01-26 11:38:28 -05:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
<p><strong>Resources</strong></p>
|
|
|
|
<ul>
|
2004-02-28 21:43:36 -05:00
|
|
|
<li> <a href="http://wiki.apache.org/jakarta-lucene">Wiki</a>
|
|
|
|
</li>
|
2004-12-30 16:50:43 -05:00
|
|
|
<li> <a href="http://wiki.apache.org/jakarta-lucene/LuceneFAQ">FAQ</a>
|
2002-06-20 10:23:48 -04:00
|
|
|
</li>
|
|
|
|
<li> <a href="./gettingstarted.html">Getting Started</a>
|
2002-05-16 01:16:10 -04:00
|
|
|
</li>
|
|
|
|
<li> <a href="./queryparsersyntax.html">Query Syntax</a>
|
2002-10-29 23:14:11 -05:00
|
|
|
</li>
|
|
|
|
<li> <a href="./fileformats.html">File Formats</a>
|
2006-09-11 21:05:20 -04:00
|
|
|
</li>
|
|
|
|
<li> <a href="./scoring.html">Scoring</a>
|
2002-01-26 11:38:28 -05:00
|
|
|
</li>
|
|
|
|
<li> <a href="./api/index.html">Javadoc</a>
|
|
|
|
</li>
|
|
|
|
<li> <a href="./contributions.html">Contributions</a>
|
2002-12-04 00:56:33 -05:00
|
|
|
</li>
|
|
|
|
<li> <a href="./benchmarks.html">Benchmarks</a>
|
2002-11-29 16:23:47 -05:00
|
|
|
</li>
|
2005-09-21 06:41:16 -04:00
|
|
|
<li> <a href="http://issues.apache.org/jira/browse/LUCENE">Issue Tracker</a>
|
2002-12-04 00:56:33 -05:00
|
|
|
</li>
|
|
|
|
<li> <a href="./lucene-sandbox/">Lucene Sandbox</a>
|
2002-01-26 11:38:28 -05:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
<p><strong>Download</strong></p>
|
|
|
|
<ul>
|
2006-02-21 11:31:28 -05:00
|
|
|
<li> <a href="http://www.apache.org/dyn/closer.cgi/lucene/java/">Releases</a>
|
2002-01-26 11:38:28 -05:00
|
|
|
</li>
|
2006-02-21 11:31:28 -05:00
|
|
|
<li> <a href="http://svn.apache.org/viewcvs.cgi/lucene/java/">Source Repository</a>
|
2002-01-26 11:38:28 -05:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</td>
|
|
|
|
<td width="80%" align="left" valign="top">
|
|
|
|
<table border="0" cellspacing="0" cellpadding="2" width="100%">
|
|
|
|
<tr><td bgcolor="#525D76">
|
|
|
|
<font color="#ffffff" face="arial,helvetica,sanserif">
|
|
|
|
<a name="About this Document"><strong>About this Document</strong></a>
|
|
|
|
</font>
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>
|
|
|
|
<blockquote>
|
|
|
|
<p>
|
2006-08-03 18:24:42 -04:00
|
|
|
This document is intended as a "getting started" guide to installing and running the Lucene
|
|
|
|
web application demo. This guide assumes that you have read the information in the previous two
|
|
|
|
examples. We'll use Tomcat as our reference web container. These demos should work with nearly any
|
|
|
|
container, but you may have to adapt them appropriately.
|
2002-01-26 11:38:28 -05:00
|
|
|
</p>
|
|
|
|
</blockquote>
|
|
|
|
</p>
|
|
|
|
</td></tr>
|
|
|
|
<tr><td><br/></td></tr>
|
|
|
|
</table>
|
|
|
|
<table border="0" cellspacing="0" cellpadding="2" width="100%">
|
|
|
|
<tr><td bgcolor="#525D76">
|
|
|
|
<font color="#ffffff" face="arial,helvetica,sanserif">
|
|
|
|
<a name="About the Demos"><strong>About the Demos</strong></a>
|
|
|
|
</font>
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>
|
|
|
|
<blockquote>
|
|
|
|
<p>
|
2006-08-03 18:24:42 -04:00
|
|
|
The Lucene Web Application demo is a template web application intended for deployment on Tomcat or a
|
|
|
|
similar web container. It's NOT designed as a "best practices" implementation by ANY means. It's
|
|
|
|
more of a "hello world" type Lucene Web App. The purpose of this application is to demonstrate
|
|
|
|
Lucene. With that being said, it should be relatively simple to create a small searchable website
|
|
|
|
in Tomcat or a similar application server.
|
2002-01-26 11:38:28 -05:00
|
|
|
</p>
|
|
|
|
</blockquote>
|
|
|
|
</p>
|
|
|
|
</td></tr>
|
|
|
|
<tr><td><br/></td></tr>
|
|
|
|
</table>
|
|
|
|
<table border="0" cellspacing="0" cellpadding="2" width="100%">
|
|
|
|
<tr><td bgcolor="#525D76">
|
|
|
|
<font color="#ffffff" face="arial,helvetica,sanserif">
|
|
|
|
<a name="Indexing Files"><strong>Indexing Files</strong></a>
|
|
|
|
</font>
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>
|
|
|
|
<blockquote>
|
2006-08-03 18:24:42 -04:00
|
|
|
<p> Once you've gotten this far you're probably itching to go. Let's start by creating the index
|
|
|
|
you'll need for the web examples. Since you've already set your CLASSPATH in the previous examples,
|
|
|
|
all you need to do is type:
|
|
|
|
|
|
|
|
<pre>
|
|
|
|
java org.apache.lucene.demo.IndexHTML -create -index {index-dir} ..
|
|
|
|
</pre>
|
|
|
|
|
|
|
|
You'll need to do this from a (any) subdirectory of your <code>{tomcat}/webapps</code> directory
|
|
|
|
(make sure you didn't leave off the <code>..</code> or you'll get a null pointer exception).
|
|
|
|
<code>{index-dir}</code> should be a directory that Tomcat has permission to read and write, but is
|
|
|
|
outside of a web accessible context. By default the webapp is configured to look in
|
|
|
|
<code>/opt/lucene/index</code> for this index.
|
2002-01-26 11:38:28 -05:00
|
|
|
</p>
|
|
|
|
</blockquote>
|
|
|
|
</p>
|
|
|
|
</td></tr>
|
|
|
|
<tr><td><br/></td></tr>
|
|
|
|
</table>
|
|
|
|
<table border="0" cellspacing="0" cellpadding="2" width="100%">
|
|
|
|
<tr><td bgcolor="#525D76">
|
|
|
|
<font color="#ffffff" face="arial,helvetica,sanserif">
|
|
|
|
<a name="Deploying the Demos"><strong>Deploying the Demos</strong></a>
|
|
|
|
</font>
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>
|
|
|
|
<blockquote>
|
2006-08-03 18:24:42 -04:00
|
|
|
<p>Located in your distribution directory you should see a war file called
|
|
|
|
<code>luceneweb.war</code>. If you're working with a Subversion checkout, this will be under the
|
|
|
|
<code>build</code> subdirectory. Copy this to your <code>{tomcat-home}/webapps</code> directory.
|
|
|
|
You may need to restart Tomcat. </p>
|
2002-01-26 11:38:28 -05:00
|
|
|
</blockquote>
|
|
|
|
</p>
|
|
|
|
</td></tr>
|
|
|
|
<tr><td><br/></td></tr>
|
|
|
|
</table>
|
|
|
|
<table border="0" cellspacing="0" cellpadding="2" width="100%">
|
|
|
|
<tr><td bgcolor="#525D76">
|
|
|
|
<font color="#ffffff" face="arial,helvetica,sanserif">
|
|
|
|
<a name="Configuration"><strong>Configuration</strong></a>
|
|
|
|
</font>
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>
|
|
|
|
<blockquote>
|
2006-08-03 18:24:42 -04:00
|
|
|
<p> From your Tomcat directory look in the <code>webapps/luceneweb</code> subdirectory. If it's not
|
|
|
|
present, try browsing to <code>http://localhost:8080/luceneweb</code> (which causes Tomcat to deploy
|
|
|
|
the webapp), then look again. Edit a file called <code>configuration.jsp</code>. Ensure that the
|
|
|
|
<code>indexLocation</code> is equal to the location you used for your index. You may also customize
|
|
|
|
the <code>appTitle</code> and <code>appFooter</code> strings as you see fit. Once you have finished
|
|
|
|
altering the configuration you may need to restart Tomcat. You may also wish to update the war file
|
|
|
|
by typing <code>jar -uf luceneweb.war configuration.jsp</code> from the <code>luceneweb</code>
|
|
|
|
subdirectory. (The -u option is not available in all versions of jar. In this case recreate the
|
|
|
|
war file).
|
2002-01-26 11:38:28 -05:00
|
|
|
</p>
|
|
|
|
</blockquote>
|
|
|
|
</p>
|
|
|
|
</td></tr>
|
|
|
|
<tr><td><br/></td></tr>
|
|
|
|
</table>
|
|
|
|
<table border="0" cellspacing="0" cellpadding="2" width="100%">
|
|
|
|
<tr><td bgcolor="#525D76">
|
|
|
|
<font color="#ffffff" face="arial,helvetica,sanserif">
|
|
|
|
<a name="Running the Demos"><strong>Running the Demos</strong></a>
|
|
|
|
</font>
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>
|
|
|
|
<blockquote>
|
2006-08-03 18:24:42 -04:00
|
|
|
<p>Now you're ready to roll. In your browser set the url to
|
|
|
|
<code>http://localhost:8080/luceneweb</code> enter <code>test</code> and the number of items per
|
|
|
|
page and press search.</p>
|
|
|
|
<p>You should now be looking either at a number of results (provided you didn't erase the Tomcat
|
|
|
|
examples) or nothing. If you get an error regarding opening the index, then you probably set the
|
|
|
|
path in <code>configuration.jsp</code> incorrectly or Tomcat doesn't have permissions to the index
|
|
|
|
(or you skipped the step of creating it). Try other search terms. Depending on the number of items
|
|
|
|
per page you set and results returned, there may be a link at the bottom that says <b>More
|
|
|
|
Results>></b>; clicking it takes you to subsequent pages. </p>
|
2002-01-26 11:38:28 -05:00
|
|
|
</blockquote>
|
|
|
|
</p>
|
|
|
|
</td></tr>
|
|
|
|
<tr><td><br/></td></tr>
|
|
|
|
</table>
|
|
|
|
<table border="0" cellspacing="0" cellpadding="2" width="100%">
|
|
|
|
<tr><td bgcolor="#525D76">
|
|
|
|
<font color="#ffffff" face="arial,helvetica,sanserif">
|
|
|
|
<a name="About the code..."><strong>About the code...</strong></a>
|
|
|
|
</font>
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>
|
|
|
|
<blockquote>
|
|
|
|
<p>
|
2006-08-03 18:24:42 -04:00
|
|
|
If you want to know more about how this web app works or how to customize it then <a href="demo4.html">read on>>></a>.
|
2002-01-26 11:38:28 -05:00
|
|
|
</p>
|
|
|
|
</blockquote>
|
|
|
|
</p>
|
|
|
|
</td></tr>
|
|
|
|
<tr><td><br/></td></tr>
|
|
|
|
</table>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<!-- FOOTER -->
|
|
|
|
<tr><td colspan="2">
|
|
|
|
<hr noshade="" size="1"/>
|
|
|
|
</td></tr>
|
|
|
|
<tr><td colspan="2">
|
|
|
|
<div align="center"><font color="#525D76" size="-1"><em>
|
2005-01-18 08:57:32 -05:00
|
|
|
Copyright © 1999-2005, The Apache Software Foundation
|
2002-01-26 11:38:28 -05:00
|
|
|
</em></font></div>
|
|
|
|
</td></tr>
|
|
|
|
</table>
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
<!-- end the processing -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2002-02-09 07:39:16 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|