public interface IndexTools
Modifier and Type | Method and Description |
---|---|
void |
addDocument(Document doc,
Analyzer analyzer)
Add new document to this index.
|
CheckIndex.Status |
checkIndex(PrintStream ps)
Check the current index status.
|
void |
createNewIndex()
Create a new index.
|
void |
createNewIndex(String dataDir)
Create a new index with sample documents.
|
void |
deleteDocuments(Query query)
Delete documents from this index by the specified query.
|
String |
exportTerms(String destDir,
String field,
String delimiter)
Export terms from given field into a new file on the destination directory
|
void |
optimize(boolean expunge,
int maxNumSegments,
PrintStream ps)
Execute force merges.
|
void |
repairIndex(CheckIndex.Status st,
PrintStream ps)
Try to repair the corrupted index using previously returned index status.
|
void optimize(boolean expunge, int maxNumSegments, PrintStream ps)
Merges are executed until there are maxNumSegments segments.
When expunge is true, maxNumSegments parameter is ignored.
expunge
- - if true, only segments having deleted documents are mergedmaxNumSegments
- - max number of segmentsps
- - information streamLukeException
- - if an internal error occurs when accessing indexCheckIndex.Status checkIndex(PrintStream ps)
ps
- information streamLukeException
- - if an internal error occurs when accessing indexvoid repairIndex(CheckIndex.Status st, PrintStream ps)
This method must be called with the return value from checkIndex(PrintStream)
.
st
- - index statusps
- - information streamLukeException
- - if an internal error occurs when accessing indexvoid addDocument(Document doc, Analyzer analyzer)
doc
- - document to be addedanalyzer
- - analyzer for parsing to documentLukeException
- - if an internal error occurs when accessing indexvoid deleteDocuments(Query query)
query
- - query for deletingLukeException
- - if an internal error occurs when accessing indexvoid createNewIndex()
LukeException
- - if an internal error occurs when accessing indexvoid createNewIndex(String dataDir)
dataDir
- - the directory path which contains sample documents (20 Newsgroups).String exportTerms(String destDir, String field, String delimiter)
destDir
- - destination directoryfield
- - field namedelimiter
- - delimiter to separate terms and their frequencyCopyright © 2000-2021 Apache Software Foundation. All Rights Reserved.