public class LuceneGenerator extends Object implements IndexGenerator
| Constructor and Description |
|---|
LuceneGenerator(String baseIndexDir,
String deletionDir)
A constructor which sets the base directory for Index directories, and
the directory in which to store deletion files.
|
| Modifier and Type | Method and Description |
|---|---|
void |
abort()
Deletes inserted rowsets since last
commit() |
void |
close()
Frees any resources used for updating indexes if any.
|
void |
closeIndex()
Closes the index committing any uncommitted insertions
|
void |
commit()
Commits inserted rowsets
|
void |
createIndex(String indexName,
FullTextIndexType idxType,
boolean forceCreate)
Creates a new index
|
File |
deleteDocuments(String[] documentIDs)
Deletes the listed documents both from the local storage and the main
index
|
int |
deleteDocumentsLocally(String[] documentIDs)
Deletes the listed documents from the local storage
|
void |
deleteIndex()
Deletes the entire index with all it's inserted rowsets.
|
long |
getCommittedFileSize()
Returns the size of the committed files
|
long |
getIndexFileSize()
Shows the current file size of the index
|
long |
getUnCommittedFileSize()
Returns the size of the uncommitted files
|
int |
insertRowSet(String rowsetXML)
Inserts rowset of supported a supported indexType.
|
int |
mergeDeletionFile(File deletionFile)
Deletes the documents from the file from the index
|
int |
mergeIndex(File inputIndex)
Merges the named index into the open index
|
void |
openIndex(String indexName)
Opens the index for insertion of rowsets
|
void |
setIndexType(FullTextIndexType idxType)
Updates the Index' state object
|
public LuceneGenerator(String baseIndexDir, String deletionDir)
baseIndexDir - -
The base directory for Index directories.deletionDir - -
The directory in which to store deletion files.public void createIndex(String indexName, FullTextIndexType idxType, boolean forceCreate) throws IndexException
createIndex in interface IndexGeneratorindexName - -
name of the indexidxType - -
the IndexType of the index to createIndexException - -
an error creating the index to createpublic void openIndex(String indexName) throws IndexException
openIndex in interface IndexGeneratorindexName - name of the indexIndexException - -
an error opening the indexpublic void setIndexType(FullTextIndexType idxType) throws IndexException
setIndexType in interface IndexGeneratorIndexException - -
an error setting the indexTypepublic long getIndexFileSize()
throws IndexException
getIndexFileSize in interface IndexGeneratorIndexException - -
an error deleting documentspublic void abort()
throws IndexException
commit()abort in interface IndexGeneratorIndexException - -
an error abortingpublic void commit()
throws IndexException
commit in interface IndexGeneratorIndexException - -
an error committingpublic long getCommittedFileSize()
throws IndexException
getCommittedFileSize in interface IndexGeneratorIndexException - -
an error getting the fileSizepublic long getUnCommittedFileSize()
throws IndexException
getUnCommittedFileSize in interface IndexGeneratorIndexException - -
an error getting the fileSizepublic int mergeIndex(File inputIndex) throws IndexException
mergeIndex in interface IndexGeneratorIndexException - -
an merging the indexpublic int mergeDeletionFile(File deletionFile) throws IndexException
mergeDeletionFile in interface IndexGeneratordeletionFile - a file identifying the documents to deleteIndexException - -
an error merging the deletion filepublic void closeIndex()
throws IndexException
closeIndex in interface IndexGeneratorIndexException - -
an error closing the Indexpublic void close()
close in interface IndexGeneratorpublic void deleteIndex()
throws IndexException
Warning: there is no undelete method.
deleteIndex in interface IndexGeneratorIndexException - -
an error deleting documentspublic File deleteDocuments(String[] documentIDs) throws IndexException
deleteDocuments in interface IndexGeneratordocumentIDs - -
an array of the IDs of the documents to deleteIndexException - -
an error deleting documentspublic int deleteDocumentsLocally(String[] documentIDs) throws IndexException
deleteDocumentsLocally in interface IndexGeneratordocumentIDs - -
an array of the IDs of the documents to deleteIndexException - -
an error deleting documentspublic int insertRowSet(String rowsetXML) throws IndexException
insertRowSet in interface IndexGeneratorrowsetXML - xml that contain data to insertIndexException - -
an error inserting the ROWSETCopyright © 2014. All Rights Reserved.