Modifier and Type | Field and Description |
---|---|
protected org.apache.lucene.index.IndexWriter |
writer |
Constructor and 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.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
INTERNAL: Closes the indexer.
|
void |
delete()
INTERNAL: Deletes the index.
|
void |
delete(String field,
String value)
INTERNAL: Removes all documents with the specified field value from
the index.
|
void |
flush()
INTERNAL: Flushes all changes done to the index.
|
int |
getDocs()
INTERNAL: Returns the number of documents stored in the index.
|
protected org.apache.lucene.document.Document |
getDocument(DocumentIF document) |
protected org.apache.lucene.document.Field |
getField(FieldIF field) |
protected org.apache.lucene.document.FieldType |
getFieldType(FieldIF field) |
protected String |
getStringValue(Reader reader) |
void |
index(DocumentIF document)
INTERNAL: Indexes the specified document.
|
public LuceneIndexer(org.apache.lucene.index.IndexWriter writer)
public int getDocs() throws IOException
IOException
public void index(DocumentIF document) throws IOException
IndexerIF
index
in interface IndexerIF
IOException
public void delete(String field, String value) throws IOException
IndexerIF
delete
in interface IndexerIF
IOException
public void flush() throws IOException
IndexerIF
flush
in interface IndexerIF
IOException
public void delete() throws IOException
IndexerIF
delete
in interface IndexerIF
IOException
public void close() throws IOException
IndexerIF
close
in interface IndexerIF
IOException
protected org.apache.lucene.document.Document getDocument(DocumentIF document) throws IOException
IOException
protected org.apache.lucene.document.Field getField(FieldIF field) throws IOException
IOException
protected org.apache.lucene.document.FieldType getFieldType(FieldIF field)
protected String getStringValue(Reader reader) throws IOException
IOException