|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object gate.creole.annic.lucene.LuceneIndexer
public class LuceneIndexer
This class provides a Lucene based implementation for the Indexer interface. It asks users to provide various required parameters and creates the Lucene Index.
Field Summary | |
---|---|
protected Corpus |
corpus
An corpus for indexing |
protected boolean |
DEBUG
|
protected Map |
parameters
Various parameters such as location of the Index etc. |
Constructor Summary | |
---|---|
LuceneIndexer(URL indexLocationUrl)
Constructor |
Method Summary | |
---|---|
void |
add(String corpusPersistenceID,
List<Document> added)
Add new documents to Index |
protected void |
checkIndexParameters(Map parameters)
Checks the Index Parameters to see if they are all compatible |
void |
createIndex(Map indexParameters)
Creates index directory and indexing all documents in the corpus. |
void |
deleteIndex()
Deletes the index. |
Corpus |
getCorpus()
Returns the corpus. |
protected Map |
getIndexParameters()
Returns the indexing parameters |
Set<String> |
getNamesOfSerializedFiles(String documentID)
This method returns a set of annotation set names that are indexed. |
Map |
getParameters()
Returns the set parameters |
void |
optimizeIndex()
Optimize existing index. |
void |
remove(List removedIDs)
remove documents from the Index |
void |
setCorpus(Corpus corpus)
Sets the corpus. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean DEBUG
protected Corpus corpus
protected Map parameters
Constructor Detail |
---|
public LuceneIndexer(URL indexLocationUrl) throws IOException
indexLocationUrl
-
IOException
Method Detail |
---|
protected void checkIndexParameters(Map parameters) throws IndexException
IndexException
protected Map getIndexParameters()
public void createIndex(Map indexParameters) throws IndexException
createIndex
in interface Indexer
indexParameters
- This is a map containing various values
required to create an index In case of LuceneIndexManager
following are the values required
INDEX_LOCATION_URL - this is a URL where the Index be created
BASE_TOKEN_ANNOTATION_TYPE
INDEX_UNIT_ANNOTATION_TYPE
FEATURES_TO_EXCLUDE
FEATURES_TO_INCLUDE
IndexException
public void optimizeIndex() throws IndexException
optimizeIndex
in interface Indexer
IndexException
public void deleteIndex() throws IndexException
deleteIndex
in interface Indexer
IndexException
public void add(String corpusPersistenceID, List<Document> added) throws IndexException
add
in interface Indexer
IndexException
public void remove(List removedIDs) throws IndexException
remove
in interface Indexer
removedIDs
- - when documents are not
peristed, Persistence IDs will not be available In that
case provide the document Names instead of their IDs
Exception
IndexException
public Corpus getCorpus()
getCorpus
in interface Indexer
public void setCorpus(Corpus corpus) throws IndexException
setCorpus
in interface Indexer
IndexException
public Map getParameters()
getParameters
in interface Indexer
public Set<String> getNamesOfSerializedFiles(String documentID) throws IndexException
IndexException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |