|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.mayo.informatics.indexer.lucene.Index
public class Index
This is an abstracted view of an lucene index.
Field Summary | |
---|---|
static java.lang.String |
UNIQUE_DOCUMENT_IDENTIFIER_FIELD
|
Constructor Summary | |
---|---|
Index(java.io.File location,
org.apache.lucene.analysis.Analyzer analyzer)
Opens an index using a provided analyzer. |
|
Index(java.io.File location,
java.lang.String[] stopWords)
This constructor will open an index using a StandardAnalyzer. |
Method Summary | |
---|---|
void |
addDocument(org.apache.lucene.document.Document document)
Adds a document to the currently open indexWriter. |
void |
addDocument(org.apache.lucene.document.Document document,
org.apache.lucene.analysis.Analyzer analyzer)
Adds a document to the currently open indexWriter. |
void |
closeIndexReader()
|
void |
closeIndexWriter()
Closes the currently opened indexWriter. |
LuceneIndexReader |
getIndexReader()
|
LuceneIndexReader |
getIndexReader(boolean useInMemoryIndex)
|
java.io.File |
getLocation()
|
void |
openBatchFSIndexWriter(boolean clearContents)
Open the index for adding new documents. |
void |
openBatchRAMIndexWriter(boolean clearContents)
Open the index for adding new documents. |
void |
openFSIndexWriter(boolean clearContents)
Open the index for adding new documents. |
void |
openIndexReader()
|
void |
openIndexReader(boolean useInMemoryIndex)
|
void |
optimizeIndex()
|
int |
removeDocument(java.lang.String uniqueDocumentIdentifier)
|
int |
removeDocument(java.lang.String field,
java.lang.String fieldValue)
|
void |
setAnalyzer(org.apache.lucene.analysis.Analyzer analyzer)
Change the analyzer of an index. |
void |
setDocsPerTempIndex(int i)
How many documents to write out per temporary index. |
void |
setMaxBufferedDocs(int i)
See the lucene documentation. |
void |
setMaxFieldLength(int i)
Lucene will truncate fields longer than this. |
void |
setMaxMergeDocs(int i)
See the lucene documentation. |
void |
setMergeFactor(int i)
How many documents to add in memory before writing to the index. |
void |
setUseCompoundFile(boolean bool)
Whether or not to use the new compound file format. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String UNIQUE_DOCUMENT_IDENTIFIER_FIELD
Constructor Detail |
---|
public Index(java.io.File location, org.apache.lucene.analysis.Analyzer analyzer)
location
- Location on disk to index to.analyzer
- The analyzer to use while indexingpublic Index(java.io.File location, java.lang.String[] stopWords)
location
- Location on the disk to create the indexstopWords
- Optional list of stopwords (words not to index) to use in the
StandardAnalyzer.Method Detail |
---|
public void openBatchRAMIndexWriter(boolean clearContents) throws IndexWriterAlreadyOpenException, InternalIndexerErrorException
clearContents
- True to erase current contents, false to append to them
IndexWriterAlreadyOpenException
- Thrown if a indexWriter is already open.
InternalIndexerErrorException
- Thrown if an unexpected error occurs.public void openBatchFSIndexWriter(boolean clearContents) throws InternalIndexerErrorException, IndexWriterAlreadyOpenException
clearContents
- True to erase current contents, false to append to them
IndexWriterAlreadyOpenException
- Thrown if a indexWriter is already open.
InternalIndexerErrorException
- Thrown if an unexpected error occurs.public void openFSIndexWriter(boolean clearContents) throws InternalIndexerErrorException, IndexWriterAlreadyOpenException
clearContents
- True to erase current contents, false to append to them
IndexWriterAlreadyOpenException
- Thrown if a indexWriter is already open.
InternalIndexerErrorException
- Thrown if an unexpected error occurs.public void closeIndexWriter() throws InternalIndexerErrorException
InternalIndexerErrorException
public void openIndexReader() throws InternalIndexerErrorException
InternalIndexerErrorException
public void openIndexReader(boolean useInMemoryIndex) throws InternalIndexerErrorException
InternalIndexerErrorException
public LuceneIndexReader getIndexReader() throws InternalIndexerErrorException
InternalIndexerErrorException
public LuceneIndexReader getIndexReader(boolean useInMemoryIndex) throws InternalIndexerErrorException
InternalIndexerErrorException
public void closeIndexReader() throws InternalIndexerErrorException
InternalIndexerErrorException
public void addDocument(org.apache.lucene.document.Document document) throws InternalIndexerErrorException
document
- The document to add to the index.
InternalIndexerErrorException
IndexWriterNotOpenException
public void addDocument(org.apache.lucene.document.Document document, org.apache.lucene.analysis.Analyzer analyzer) throws InternalIndexerErrorException
document
- The document to add to the index.analyzer
- The analyzer to use
InternalIndexerErrorException
IndexWriterNotOpenException
public int removeDocument(java.lang.String uniqueDocumentIdentifier) throws InternalIndexerErrorException, OperatorErrorException
InternalIndexerErrorException
OperatorErrorException
public int removeDocument(java.lang.String field, java.lang.String fieldValue) throws OperatorErrorException, InternalIndexerErrorException
OperatorErrorException
InternalIndexerErrorException
public void optimizeIndex() throws InternalIndexerErrorException
InternalIndexerErrorException
public void setDocsPerTempIndex(int i) throws OperatorErrorException
i
- - How many docs to add to the index before opening a new
temporary index.
OperatorErrorException
public void setMaxFieldLength(int i) throws OperatorErrorException
i
- The max length that a field can be.
OperatorErrorException
public void setMaxBufferedDocs(int i) throws OperatorErrorException
i
-
OperatorErrorException
public void setMaxMergeDocs(int i) throws OperatorErrorException
i
-
OperatorErrorException
public void setMergeFactor(int i) throws OperatorErrorException
i
- How many docs to add before writing.
OperatorErrorException
public void setUseCompoundFile(boolean bool) throws OperatorErrorException
bool
-
OperatorErrorException
public java.io.File getLocation()
public void setAnalyzer(org.apache.lucene.analysis.Analyzer analyzer)
analyzer
-
|
Copyright: (c) 2004-2006 Mayo Foundation for Medical Education and Research (MFMER). All rights reserved. MAYO, MAYO CLINIC, and the triple-shield Mayo logo are trademarks and service marks of MFMER. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |