12.5. Obtaining Jakarta Lucene

Problem

You need to use Jakarta Lucene to create a searchable index of documents.

Solution

Download Jakarta Lucene 1.4 from http://jakarta.apache.org/site/binindex.cgi, and uncompress the distribution archive. Place the file://lucene-1.4-final.jar file in your classpath.

Discussion

Jakarta Lucene is a full-text search engine that can be used to index any information. Lucene maintains an index of Document objects that can contain any number of fields, and this index can be searched using a highly developed query language.

If you have a Maven project that needs to use Jakarta Lucene, add a dependency on Jakarta Lucene 1.4 with the following section in project.xml:

<dependencies>
  <dependency>
    <id>lucene</id>
    <version>1.4</version>
  </dependency>
  ....other dependencies...
</dependencies>

See Also

For more information on the Jakarta Lucene project, see the Jakarta Lucene project page at http://jakarta.apache.org/lucene.

Get Jakarta Commons Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.