|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.ontopia.infoset.fulltext.impl.lucene.LuceneIndexer
public class LuceneIndexer
INTERNAL: The Lucene indexer implementation. This indexer uses the Lucene search engine to index documents.
Field Summary | |
---|---|
protected org.apache.lucene.analysis.Analyzer |
analyzer
|
protected org.apache.lucene.store.Directory |
dir
|
protected java.lang.String |
path
|
protected org.apache.lucene.index.IndexReader |
reader
|
protected org.apache.lucene.index.IndexWriter |
writer
|
Constructor Summary | |
---|---|
LuceneIndexer(org.apache.lucene.store.Directory dir,
org.apache.lucene.analysis.Analyzer analyzer,
boolean create)
INTERNAL: Creates an indexer instance that will store its index in the given lucene directory and use the specified token stream analyzer. |
|
LuceneIndexer(org.apache.lucene.store.Directory dir,
boolean create)
INTERNAL: Creates an indexer instance that will store its index in the given lucene directory and use the default token stream analyzer. |
|
LuceneIndexer(java.lang.String path,
org.apache.lucene.analysis.Analyzer analyzer,
boolean create)
INTERNAL: Creates an indexer instance that will store its index in the given file system directory and use the specified token stream analyzer. |
|
LuceneIndexer(java.lang.String path,
boolean create)
INTERNAL: Creates an indexer instance that will store its index in the given file system directory. |
Method Summary | |
---|---|
void |
close()
INTERNAL: Closes the indexer. |
void |
delete()
INTERNAL: Deletes the index. |
int |
delete(java.lang.String field,
java.lang.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.Field.Index |
getIndexSetting(FieldIF field)
|
java.lang.String |
getPath()
INTERNAL: Returns the path where the index used is stored. |
protected org.apache.lucene.index.IndexReader |
getReader()
|
protected org.apache.lucene.document.Field.Store |
getStoreSetting(FieldIF field)
|
protected java.lang.String |
getStringValue(java.io.Reader reader)
|
protected org.apache.lucene.index.IndexWriter |
getWriter()
|
void |
index(DocumentIF document)
INTERNAL: Indexes the specified document. |
static void |
main(java.lang.String[] argv)
INTERNAL: Command line version of the indexer. |
protected static void |
usage()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.String path
protected org.apache.lucene.store.Directory dir
protected org.apache.lucene.analysis.Analyzer analyzer
protected org.apache.lucene.index.IndexWriter writer
protected org.apache.lucene.index.IndexReader reader
Constructor Detail |
---|
public LuceneIndexer(java.lang.String path, boolean create) throws java.io.IOException
path
- The file system directory where the index is located.create
- If true the indexer will create a new index (replacing
the old one, if there is one). If false the indexed
information will be added to the existing index.
java.io.IOException
public LuceneIndexer(java.lang.String path, org.apache.lucene.analysis.Analyzer analyzer, boolean create) throws java.io.IOException
path
- The file system directory where the index is located.analyzer
- The token stream analyzer that the searcer is to use.create
- If true the indexer will create a new index (replacing
the old one, if there is one). If false the indexed
information will be added to the existing index.
java.io.IOException
public LuceneIndexer(org.apache.lucene.store.Directory dir, boolean create) throws java.io.IOException
dir
- The lucene directory where the index is located.create
- If true the indexer will create a new index (replacing
the old one, if there is one). If false the indexed
information will be added to the existing index.
java.io.IOException
public LuceneIndexer(org.apache.lucene.store.Directory dir, org.apache.lucene.analysis.Analyzer analyzer, boolean create) throws java.io.IOException
dir
- The lucene directory where the index is located.analyzer
- The token stream analyzer that the searcer is to use.create
- If true the indexer will create a new index (replacing
the old one, if there is one). If false the indexed
information will be added to the existing index.
java.io.IOException
Method Detail |
---|
protected org.apache.lucene.index.IndexWriter getWriter()
protected org.apache.lucene.index.IndexReader getReader()
public java.lang.String getPath()
public int getDocs()
public void index(DocumentIF document) throws java.io.IOException
IndexerIF
index
in interface IndexerIF
java.io.IOException
public int delete(java.lang.String field, java.lang.String value) throws java.io.IOException
IndexerIF
delete
in interface IndexerIF
java.io.IOException
public void flush() throws java.io.IOException
IndexerIF
flush
in interface IndexerIF
java.io.IOException
public void delete() throws java.io.IOException
IndexerIF
delete
in interface IndexerIF
java.io.IOException
public void close() throws java.io.IOException
IndexerIF
close
in interface IndexerIF
java.io.IOException
protected org.apache.lucene.document.Document getDocument(DocumentIF document) throws java.io.IOException
java.io.IOException
protected org.apache.lucene.document.Field getField(FieldIF field) throws java.io.IOException
java.io.IOException
protected org.apache.lucene.document.Field.Store getStoreSetting(FieldIF field)
protected org.apache.lucene.document.Field.Index getIndexSetting(FieldIF field)
protected java.lang.String getStringValue(java.io.Reader reader) throws java.io.IOException
java.io.IOException
public static void main(java.lang.String[] argv)
protected static void usage()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |