1 / 5

Lucene Homework

Lucene Homework. Search, Corpora Characteristics, & Lucene Introduction. Lucene Intro. Lucene is an open source library that allows indexing and search applications to be built It is not a standalone application The Lucene demos provide starting points. Lucene CLASSPATH variable.

arachel
Download Presentation

Lucene Homework

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lucene Homework Search, Corpora Characteristics, & Lucene Introduction

  2. Lucene Intro • Lucene is an open source library that allows indexing and search applications to be built • It is not a standalone application • The Lucene demos provide starting points

  3. Lucene CLASSPATH variable • If you installed lucene @ c:\, your CLASSPATH variable is: .; C:\lucene-2.4.0\lucene-core-2.4.0.jar;C:\lucene-2.4.0\lucene-demos-2.4.0.jar; watch the periods & hyphens watch the ‘s’

  4. Lucene IndexFiles Demo Changes I made to IndexFiles.java -- //package org.apache.lucene.demo; <- COMMENT THIS OUT import org.apache.lucene.analysis.standard.StandardAnalyzer; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.demo.FileDocument; <- ADD THIS import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.util.Date;

  5. Changing invoked analyzer Put different analyzers here Date start = new Date(); try { IndexWriter writer = new IndexWriter(INDEX_DIR, new StandardAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED); System.out.println("Indexing to directory '" +INDEX_DIR+ "'..."); indexDocs(writer, docDir); System.out.println("Optimizing..."); writer.optimize(); writer.close(); Date end = new Date(); System.out.println(end.getTime() - start.getTime() + " total milliseconds"); } catch (IOException e) { System.out.println(" caught a " + e.getClass() + "\n with message: " + e.getMessage()); }();

More Related