info.aduna.infosource.crawl.index
Class LuceneIndex
java.lang.Object
info.aduna.infosource.crawl.index.LuceneIndex
public class LuceneIndex
- extends Object
Class representing a Lucene index which handles read/write synchronization.
|
Constructor Summary |
LuceneIndex(File indexDir,
org.apache.lucene.analysis.Analyzer analyzer)
Creates and initializes a Lucene index. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SEARCH_FIELDS
public static final String[] SEARCH_FIELDS
LuceneIndex
public LuceneIndex(File indexDir,
org.apache.lucene.analysis.Analyzer analyzer)
throws IOException
- Creates and initializes a Lucene index.
- Parameters:
indexDir - The directory in which the Lucene index can be found or should be
created.analyzer - The Analyzer to use for indexing document text.
- Throws:
IOException
getAnalyzer
public org.apache.lucene.analysis.Analyzer getAnalyzer()
search
public void search(String query,
LuceneSearchResultListener listener)
throws IOException,
org.apache.lucene.queryParser.ParseException
- Throws:
IOException
org.apache.lucene.queryParser.ParseException
search
public void search(org.apache.lucene.search.Query query,
LuceneSearchResultListener listener)
throws IOException
- Throws:
IOException
search
public org.apache.lucene.search.Hits search(String query)
throws IOException,
org.apache.lucene.queryParser.ParseException
- Throws:
IOException
org.apache.lucene.queryParser.ParseException
search
public org.apache.lucene.search.Hits search(org.apache.lucene.search.Query query)
throws IOException
- Throws:
IOException
addDocument
public void addDocument(org.apache.lucene.document.Document document)
throws IOException
- Throws:
IOException
delete
public void delete(org.apache.lucene.index.Term term)
throws IOException
- Throws:
IOException
optimize
public void optimize()
throws IOException
- Optimizes the Lucene index.
- Throws:
IOException
clear
public void clear()
throws IOException
- Gets rid of the contents of the index *without* sending any events.
- Throws:
IOException
close
public void close()
throws IOException
- Throws:
IOException
Copyright © 1997-2008 Aduna. All Rights Reserved.