|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openanzo.indexer.lucene.LuceneIndexerBase
public abstract class LuceneIndexerBase
A very simple Lucene-based indexer. If this is going to be used for heavy-duty indexing, should queue up items to be indexed by another thread.
| Constructor Summary | |
|---|---|
LuceneIndexerBase()
|
|
| Method Summary | |
|---|---|
void |
clear()
Clears the contents of the index. |
void |
close()
Closes the resources used by the indexer. |
abstract boolean |
index(int id,
java.lang.Object object)
Adds the object to the index. |
void |
initialize(java.util.Properties properties)
Initializes the indexer. |
void |
initialize(java.lang.String location,
boolean indexClear,
boolean removeLock)
Initializes the indexer. |
void |
postIndex(int id)
Flushes and optimizes the index. |
void |
postRemove(int id)
Flushes and optimizes the index. |
int |
preIndex()
A no-op. |
int |
preRemove()
A no-op. |
abstract void |
remove(int id,
java.lang.Object object)
Removes the object from the index. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.openanzo.indexer.IIndexer |
|---|
rebuild |
| Constructor Detail |
|---|
public LuceneIndexerBase()
| Method Detail |
|---|
public abstract boolean index(int id,
java.lang.Object object)
throws IndexerException
IIndexer
index in interface IIndexerid - id of the indexer, generated by preIndex()object - object to add to the index.
IndexerException
public abstract void remove(int id,
java.lang.Object object)
throws IndexerException
IIndexer
remove in interface IIndexerid - id of the indexer, generated by preIndex()object - object to remove from the index.
IndexerException
public void initialize(java.util.Properties properties)
throws IndexerException
initialize in interface IIndexerproperties - configuration for the indexer, usually comes from a .properties file
IndexerException - if there were errors initializing the indexer
public void initialize(java.lang.String location,
boolean indexClear,
boolean removeLock)
throws IndexerException
location - the location of the directory containing the indexindexClear - whether or not the index should be cleared upon initializationremoveLock - whether or not the index's lock should be removed upon initialization
IndexerException
public int preIndex()
throws IndexerException
preIndex in interface IIndexerIndexerException
public void postIndex(int id)
throws IndexerException
postIndex in interface IIndexerid - not used
IndexerException
public int preRemove()
throws IndexerException
preRemove in interface IIndexerIndexerException
public void postRemove(int id)
throws IndexerException
postRemove in interface IIndexerid - not used
IndexerException
public void clear()
throws IndexerException
IIndexer
clear in interface IIndexerIndexerException
public void close()
throws IndexerException
close in interface IIndexerIndexerException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||