Class LuceneIndexer
- java.lang.Object
-
- net.ontopia.infoset.fulltext.impl.lucene.LuceneIndexer
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.lucene.index.IndexWriterwriter
-
Constructor Summary
Constructors Constructor Description LuceneIndexer(org.apache.lucene.index.IndexWriter writer)INTERNAL: Creates an indexer instance that will store its index in the given lucene directory and use the specified token stream analyzer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()INTERNAL: Closes the indexer.voiddelete()INTERNAL: Deletes the index.voiddelete(String field, String value)INTERNAL: Removes all documents with the specified field value from the index.voidflush()INTERNAL: Flushes all changes done to the index.intgetDocs()INTERNAL: Returns the number of documents stored in the index.protected org.apache.lucene.document.DocumentgetDocument(DocumentIF document)protected org.apache.lucene.document.FieldgetField(FieldIF field)protected org.apache.lucene.document.FieldTypegetFieldType(FieldIF field)protected StringgetStringValue(Reader reader)voidindex(DocumentIF document)INTERNAL: Indexes the specified document.
-
-
-
Method Detail
-
getDocs
public int getDocs() throws IOExceptionINTERNAL: Returns the number of documents stored in the index.- Throws:
IOException
-
index
public void index(DocumentIF document) throws IOException
Description copied from interface:IndexerIFINTERNAL: Indexes the specified document. This includes tokenizing, indexing and storing the document fields.- Specified by:
indexin interfaceIndexerIF- Throws:
IOException
-
delete
public void delete(String field, String value) throws IOException
Description copied from interface:IndexerIFINTERNAL: Removes all documents with the specified field value from the index. This method should generally be, but is not limited to, used to delete documents by their identity field.- Specified by:
deletein interfaceIndexerIF- Throws:
IOException
-
flush
public void flush() throws IOExceptionDescription copied from interface:IndexerIFINTERNAL: Flushes all changes done to the index. A flushing operation can include actions like persisting changes and optimizing the index.- Specified by:
flushin interfaceIndexerIF- Throws:
IOException
-
delete
public void delete() throws IOExceptionDescription copied from interface:IndexerIFINTERNAL: Deletes the index. The indexer is closed after this method returns. Note that some indexers might not support this operation.- Specified by:
deletein interfaceIndexerIF- Throws:
IOException
-
close
public void close() throws IOExceptionDescription copied from interface:IndexerIFINTERNAL: Closes the indexer. After the indexer has been closed it cannot (generally) be reopened.- Specified by:
closein interfaceIndexerIF- Throws:
IOException
-
getDocument
protected org.apache.lucene.document.Document getDocument(DocumentIF document) throws IOException
- Throws:
IOException
-
getField
protected org.apache.lucene.document.Field getField(FieldIF field) throws IOException
- Throws:
IOException
-
getFieldType
protected org.apache.lucene.document.FieldType getFieldType(FieldIF field)
-
getStringValue
protected String getStringValue(Reader reader) throws IOException
- Throws:
IOException
-
-