Class LuceneIndexer
java.lang.Object
net.ontopia.infoset.fulltext.impl.lucene.LuceneIndexer
- All Implemented Interfaces:
IndexerIF
INTERNAL: The Lucene indexer implementation. This indexer uses the
Lucene search engine to index documents.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLuceneIndexer(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
Modifier and TypeMethodDescriptionvoidclose()INTERNAL: Closes the indexer.voiddelete()INTERNAL: Deletes the index.voidINTERNAL: 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.Fieldprotected org.apache.lucene.document.FieldTypegetFieldType(FieldIF field) protected StringgetStringValue(Reader reader) voidindex(DocumentIF document) INTERNAL: Indexes the specified document.
-
Field Details
-
writer
protected org.apache.lucene.index.IndexWriter writer
-
-
Constructor Details
-
LuceneIndexer
public 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 Details
-
getDocs
INTERNAL: Returns the number of documents stored in the index.- Throws:
IOException
-
index
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
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
Description 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
Description 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
Description 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
- Throws:
IOException
-
getField
- Throws:
IOException
-
getFieldType
-
getStringValue
- Throws:
IOException
-