info.aduna.infosource.crawl.index
Class LuceneIndex

java.lang.Object
  extended by info.aduna.infosource.crawl.index.LuceneIndex

public class LuceneIndex
extends Object

Class representing a Lucene index which handles read/write synchronization.


Field Summary
static String[] SEARCH_FIELDS
           
 
Constructor Summary
LuceneIndex(File indexDir, org.apache.lucene.analysis.Analyzer analyzer)
          Creates and initializes a Lucene index.
 
Method Summary
 void addDocument(org.apache.lucene.document.Document document)
           
 void clear()
          Gets rid of the contents of the index *without* sending any events.
 void close()
           
 void delete(org.apache.lucene.index.Term term)
           
 org.apache.lucene.analysis.Analyzer getAnalyzer()
           
 void optimize()
          Optimizes the Lucene index.
 org.apache.lucene.search.Hits search(org.apache.lucene.search.Query query)
           
 void search(org.apache.lucene.search.Query query, LuceneSearchResultListener listener)
           
 org.apache.lucene.search.Hits search(String query)
           
 void search(String query, LuceneSearchResultListener listener)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SEARCH_FIELDS

public static final String[] SEARCH_FIELDS
Constructor Detail

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
Method Detail

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.