| Modifier and Type | Field and Description |
|---|---|
protected Corpus |
corpus
An corpus for indexing
|
protected boolean |
DEBUG |
protected Map<String,Object> |
parameters
Various parameters such as location of the Index etc.
|
| Constructor and Description |
|---|
LuceneIndexer(URL indexLocationUrl)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(String corpusPersistenceID,
List<Document> added)
Add new documents to Index
|
protected void |
checkIndexParameters(Map<String,Object> parameters)
Checks the Index Parameters to see if they are all compatible
|
void |
createIndex(Map<String,Object> indexParameters)
Creates index directory and indexing all documents in the corpus.
|
void |
deleteIndex()
Deletes the index.
|
Corpus |
getCorpus()
Returns the corpus.
|
protected Map<String,Object> |
getIndexParameters()
Returns the indexing parameters
|
Set<String> |
getNamesOfSerializedFiles(String documentID)
This method returns a set of annotation set names that are indexed.
|
Map<String,Object> |
getParameters()
Returns the set parameters
|
void |
optimizeIndex()
Optimize existing index.
|
void |
remove(List<Object> removedIDs)
remove documents from the Index
|
void |
setCorpus(Corpus corpus)
Sets the corpus.
|
protected boolean DEBUG
protected Corpus corpus
public LuceneIndexer(URL indexLocationUrl) throws IOException
indexLocationUrl - IOExceptionprotected void checkIndexParameters(Map<String,Object> parameters) throws IndexException
IndexExceptionprotected Map<String,Object> getIndexParameters()
public void createIndex(Map<String,Object> indexParameters) throws IndexException
createIndex in interface IndexerindexParameters - 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
IndexExceptionpublic void optimizeIndex()
throws IndexException
optimizeIndex in interface IndexerIndexExceptionpublic void deleteIndex()
throws IndexException
deleteIndex in interface IndexerIndexExceptionpublic void add(String corpusPersistenceID, List<Document> added) throws IndexException
add in interface IndexerIndexExceptionpublic void remove(List<Object> removedIDs) throws IndexException
remove in interface IndexerremovedIDs - - when documents are not
peristed, Persistence IDs will not be available In that
case provide the document Names instead of their IDsIndexException - if an error occurs while removing documentspublic Corpus getCorpus()
public void setCorpus(Corpus corpus) throws IndexException
setCorpus in interface IndexerIndexExceptionpublic Map<String,Object> getParameters()
getParameters in interface Indexerpublic Set<String> getNamesOfSerializedFiles(String documentID) throws IndexException
IndexExceptionCopyright © 2024 GATE. All rights reserved.