The purpose of the servlet is to provide a web
interface to multiple Lucene indexes that were created by a DocSearcher
client (swing) application - and do so in a fashion that would work on
most any Java Application server.
Tomcat and Jetty deployment
Setting up a web or intranet based search engine for DocSearcher is a six-step process:
download the DocSearcher application from the
import or create your DocSearcher indexes
* Make sure the indexes are specifically created as "web server" indexes...
When you create the index:
-->click the advanced properties tab
--> click on the "web server"
radio button next to the text "type of index"
download docsearch.war from the
deploy the docsearch.war file on your application server
file to specify the proper
value for your DocSearcher deployment.
The value for this should the the folder
where the file index_list.htm is
stores the list of DocSearcher indexes you have created with the
DocSearcher client software.
Here's an example web.xml file :
<?xml version="1.0" ?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Webb
<!-- This is where the index_list.htm file is found. -->
restart the DocSearcher web application so that it can find your indexes
You can visit the servlet from:
Recompiling the servlet (DsResults)
Important source files in the docsearch.war file are the following:
- DsResults.java - this is the main servlet class that builds both the search form and its results.
- TableA.java - a utility class that DsResults uses to read the DocSearcher configutation files so that it knows where the Lucene indexes are located
- OrderReader.java - another utility class used by TableA for IO
To re-compile the servlet, ensure that the lucene.jar
(lucene-1.3-rc1 is what I used) file is one your classpath. Other than
the lucene jar file - compile like you would any servlet (i.e. javac
DsResults.java), but ensure the above 3 source files are in the
If you've successfully compiled DsResults but it doesn't seem to work -
check your Application Server's configuration file (on Jetty that would
be /etc/jetty.xml for example) to ensure the application server knows
about the servlet.
The servlet includes the following features:
- logging of searches (so webmasters can determine what their customers are looking for)
- google like interface
- default high weighting of meta data (keywords, title & summary/description) - so that webmasters/authors who put these to good use are rewarded appropriately
- search by author and other fields via advanced search functionality
If you need to read up up servlets, my best advice is to look over at
the Sun Java Tutorials for servlets or consult the documentation for
your servlet engine or J2SE/J2EE application server.
For more information about Lucene you can go to the Lucene website.