mirror of https://github.com/apache/lucene.git
306 lines
13 KiB
HTML
306 lines
13 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
|
|
<!--
|
|
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.
|
|
-->
|
|
|
|
|
|
<!-- Content Stylesheet for Site -->
|
|
|
|
|
|
<!-- start the processing -->
|
|
<!-- ====================================================================== -->
|
|
<!-- GENERATED FILE, DO NOT EDIT, EDIT THE XML FILE IN xdocs INSTEAD! -->
|
|
<!-- 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">
|
|
|
|
|
|
|
|
|
|
<title>Apache Lucene - Apache Lucene - Building and Installing the Basic Demo</title>
|
|
</head>
|
|
|
|
<body bgcolor="#ffffff" text="#000000" link="#525D76">
|
|
<table border="0" width="100%" cellspacing="0">
|
|
<!-- TOP IMAGE -->
|
|
<tr>
|
|
<td align="left">
|
|
<a href="http://jakarta.apache.org"><img src="http://jakarta.apache.org/images/jakarta-logo.gif" border="0"/></a>
|
|
</td>
|
|
<td align="right">
|
|
<a href="http://lucene.apache.org/"><img src="./images/lucene_green_300.gif" alt="Apache Lucene" border="0"/></a>
|
|
</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">
|
|
|
|
<!-- ============================================================ -->
|
|
|
|
<p><strong>About</strong></p>
|
|
<ul>
|
|
<li> <a href="./index.html">Overview</a>
|
|
</li>
|
|
<li> <a href="http://wiki.apache.org/jakarta-lucene/PoweredBy">Powered by Lucene</a>
|
|
</li>
|
|
<li> <a href="./whoweare.html">Who We Are</a>
|
|
</li>
|
|
<li> <a href="http://jakarta.apache.org/site/mail.html">Mailing Lists</a>
|
|
</li>
|
|
</ul>
|
|
<p><strong>Resources</strong></p>
|
|
<ul>
|
|
<li> <a href="http://wiki.apache.org/jakarta-lucene">Wiki</a>
|
|
</li>
|
|
<li> <a href="http://wiki.apache.org/jakarta-lucene/LuceneFAQ">FAQ</a>
|
|
</li>
|
|
<li> <a href="./gettingstarted.html">Getting Started</a>
|
|
</li>
|
|
<li> <a href="./queryparsersyntax.html">Query Syntax</a>
|
|
</li>
|
|
<li> <a href="./fileformats.html">File Formats</a>
|
|
</li>
|
|
<li> <a href="./api/index.html">Javadoc</a>
|
|
</li>
|
|
<li> <a href="./contributions.html">Contributions</a>
|
|
</li>
|
|
<li> <a href="./resources.html">Articles, etc.</a>
|
|
</li>
|
|
<li> <a href="./benchmarks.html">Benchmarks</a>
|
|
</li>
|
|
<li> <a href="http://issues.apache.org/bugzilla/buglist.cgi?bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&email1=&emailtype1=substring&emailassigned_to1=1&email2=&emailtype2=substring&emailreporter2=1&bugidtype=include&bug_id=&changedin=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&product=Lucene&short_desc=%5BPATCH%5D&short_desc_type=allwordssubstr&long_desc=&long_desc_type=allwordssubstr&bug_file_loc=&bug_file_loc_type=allwordssubstr&keywords=&keywords_type=anywords&field0-0-0=noop&type0-0-0=noop&value0-0-0=&cmdtype=doit&order=Importance">Patches</a>
|
|
</li>
|
|
<li> <a href="http://jakarta.apache.org/site/bugs.html">Bugs</a>
|
|
</li>
|
|
<li> <a href="http://issues.apache.org/bugzilla/buglist.cgi?bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&email1=&emailtype1=substring&emailassigned_to1=1&email2=&emailtype2=substring&emailreporter2=1&bugidtype=include&bug_id=&changedin=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&product=Lucene&short_desc=&short_desc_type=allwordssubstr&long_desc=&long_desc_type=allwordssubstr&bug_file_loc=&bug_file_loc_type=allwordssubstr&keywords=&keywords_type=anywords&field0-0-0=noop&type0-0-0=noop&value0-0-0=&cmdtype=doit&order=Importance">Lucene Bugs</a>
|
|
</li>
|
|
<li> <a href="http://mail-archives.apache.org/eyebrowse/SummarizeList?listId=30">Lucene-user</a>
|
|
</li>
|
|
<li> <a href="http://mail-archives.apache.org/eyebrowse/SummarizeList?listId=29">Lucene-dev</a>
|
|
</li>
|
|
<li> <a href="./lucene-sandbox/">Lucene Sandbox</a>
|
|
</li>
|
|
</ul>
|
|
<p><strong>Download</strong></p>
|
|
<ul>
|
|
<li> <a href="http://www.apache.org/dyn/closer.cgi/jakarta/lucene/binaries/">Binaries</a>
|
|
</li>
|
|
<li> <a href="http://www.apache.org/dyn/closer.cgi/jakarta/lucene/source/">Source Code</a>
|
|
</li>
|
|
<li> <a href="http://svn.apache.org/viewcvs.cgi/lucene/">Source Repository</a>
|
|
</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>
|
|
<p>
|
|
<blockquote>
|
|
<p>
|
|
This document is intended as a "getting started" guide to installing and running the
|
|
Apache Lucene web application demo. This guide assumes that you have read the
|
|
information in the previous two examples or already know it anyhow. We'll use
|
|
Tomcat 4.0.1 as our reference web container. These demos should work with nearly
|
|
any container, but it is up to you to adapt them appropriately.
|
|
</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>
|
|
<p>
|
|
<blockquote>
|
|
<p>
|
|
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.
|
|
</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>
|
|
<p>
|
|
<blockquote>
|
|
<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
|
|
<b> "java org.apache.lucene.demo.IndexHTML -create -index {index-dir} .."</b>.
|
|
You'll need to do this from a (any) subdirectory of your {tomcat}/webapps directory (make sure you didn't leave off the ".." or you'll get a null pointer
|
|
exception).
|
|
{index-dir}
|
|
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 <b>/opt/lucene/index</b> for this index.
|
|
</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>
|
|
<p>
|
|
<blockquote>
|
|
<p>Located in your distribution directory you should see
|
|
a war file called luceneweb.war. Copy this to your
|
|
{tomcat-home}/webapps directory. You may need to restart
|
|
Tomcat. </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="Configuration"><strong>Configuration</strong></a>
|
|
</font>
|
|
</td></tr>
|
|
<tr><td>
|
|
<p>
|
|
<blockquote>
|
|
<p>
|
|
From your Tomcat directory look in the webapps/luceneweb subdirectory. If it's not
|
|
present, try browsing to "http://localhost:8080/luceneweb" then look again.
|
|
Edit a file called configuration.jsp. Ensure that the indexLocation is equal to the
|
|
location you used for your index. You may also customize the appTitle and appFooter
|
|
strings as you see fit. Once you have finished altering the configuration you should
|
|
restart Tomcat. You may also wish to update the war file by typing
|
|
<b>jar -uf luceneweb.war configuration.jsp</b> from the luceneweb subdirectory.
|
|
(The -u option is not available in all versions of jar. In this case recreate the war file).
|
|
</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>
|
|
<p>
|
|
<blockquote>
|
|
<p>Now you're ready to roll. In your browser set the url to "http://localhost:8080/luceneweb"
|
|
enter "test" 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. 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 "more results>>",
|
|
clicking it goes to subsequent pages. If you get an error regarding opening the index, then you
|
|
probably set the path in "configuration" incorrectly or Tomcat doesn't have permissions to the
|
|
index (or you skipped the step of creating it).</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 code..."><strong>About the code...</strong></a>
|
|
</font>
|
|
</td></tr>
|
|
<tr><td>
|
|
<p>
|
|
<blockquote>
|
|
<p>
|
|
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>.
|
|
</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>
|
|
Copyright © 1999-2005, The Apache Software Foundation
|
|
</em></font></div>
|
|
</td></tr>
|
|
</table>
|
|
</body>
|
|
</html>
|
|
<!-- end the processing -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|