|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.store.instantiated.InstantiatedIndexWriter
public class InstantiatedIndexWriter
This class, similar to IndexWriter
, has no locking mechanism.
InstantiatedIndexReader
is navigating
the same instances in memory as this writer is updating so searchers active while
you are committing are bound to throw exceptions.
Consider using InstantiatedIndex as if it was immutable.
IndexWriter
Constructor Summary | |
---|---|
InstantiatedIndexWriter(InstantiatedIndex index)
|
|
InstantiatedIndexWriter(InstantiatedIndex index,
Analyzer analyzer)
|
|
InstantiatedIndexWriter(InstantiatedIndex index,
Analyzer analyzer,
boolean create)
|
Method Summary | |
---|---|
void |
abort()
|
void |
addDocument(Document doc)
Adds a document to this index. |
void |
addDocument(Document doc,
Analyzer analyzer)
Adds a document to this index, using the provided analyzer instead of the value of getAnalyzer() . |
protected void |
addDocument(InstantiatedDocument document,
Analyzer analyzer)
Tokenizes a document and adds it to the buffer. |
void |
addIndexes(IndexReader[] readers)
|
void |
close()
Flushes all changes to an index and closes all associated files. |
void |
commit()
Locks the index and commits the buffered documents. |
void |
deleteDocuments(Term term)
|
void |
deleteDocuments(Term[] terms)
|
int |
docCount()
Returns the number of documents currently in this index. |
Analyzer |
getAnalyzer()
|
PrintStream |
getInfoStream()
|
int |
getMaxFieldLength()
|
int |
getMergeFactor()
|
Similarity |
getSimilarity()
|
void |
setInfoStream(PrintStream infoStream)
If non-null, information about merges and a message when maxFieldLength is reached could be printed to this -- currently not yet implemented. |
void |
setMaxFieldLength(int maxFieldLength)
|
void |
setMergeFactor(int mergeFactor)
The sweetspot for this implementation is somewhere around 2500 at 2K text large documents. |
void |
setSimilarity(Similarity similarity)
|
void |
updateDocument(Term term,
Document doc)
|
void |
updateDocument(Term term,
Document doc,
Analyzer analyzer)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public InstantiatedIndexWriter(InstantiatedIndex index) throws IOException
IOException
public InstantiatedIndexWriter(InstantiatedIndex index, Analyzer analyzer) throws IOException
IOException
public InstantiatedIndexWriter(InstantiatedIndex index, Analyzer analyzer, boolean create) throws IOException
IOException
Method Detail |
---|
public void setMergeFactor(int mergeFactor)
------------> Report sum by Prefix (MAddDocs) and Round (8 about 8 out of 160153) Operation round mrg buf cmpnd runCnt recsPerRun rec/s elapsedSec avgUsedMem avgTotalMem MAddDocs_20000 0 10 10 true 1 20000 81,4 245,68 200 325 152 268 156 928 MAddDocs_20000 - 1 1000 10 true - - 1 - - 20000 - - 494,1 - - 40,47 - 247 119 072 - 347 025 408 MAddDocs_20000 2 10 100 true 1 20000 104,8 190,81 233 895 552 363 720 704 MAddDocs_20000 - 3 2000 100 true - - 1 - - 20000 - - 527,2 - - 37,94 - 266 136 448 - 378 273 792 MAddDocs_20000 4 10 10 false 1 20000 103,2 193,75 222 089 792 378 273 792 MAddDocs_20000 - 5 3000 10 false - - 1 - - 20000 - - 545,2 - - 36,69 - 237 917 152 - 378 273 792 MAddDocs_20000 6 10 100 false 1 20000 102,7 194,67 237 018 976 378 273 792 MAddDocs_20000 - 7 4000 100 false - - 1 - - 20000 - - 535,8 - - 37,33 - 309 680 640 - 501 968 896
LogMergePolicy.setMergeFactor(int)
public int getMergeFactor()
LogMergePolicy.getMergeFactor()
public void setInfoStream(PrintStream infoStream)
public void abort() throws IOException
IOException
public void addIndexes(IndexReader[] readers)
public PrintStream getInfoStream()
public void close() throws IOException
close
in interface Closeable
IOException
public int docCount()
public void commit() throws IOException
IOException
public void addDocument(Document doc) throws IOException
setMaxFieldLength(int)
terms for a given field, the remainder are
discarded.
IOException
public void addDocument(Document doc, Analyzer analyzer) throws IOException
getAnalyzer()
. If the document contains more than
setMaxFieldLength(int)
terms for a given field, the remainder are
discarded.
doc
- analyzer
-
IOException
protected void addDocument(InstantiatedDocument document, Analyzer analyzer) throws IOException
document
- analyzer
-
IOException
public void deleteDocuments(Term term) throws IOException
IOException
public void deleteDocuments(Term[] terms) throws IOException
IOException
public void updateDocument(Term term, Document doc) throws IOException
IOException
public void updateDocument(Term term, Document doc, Analyzer analyzer) throws IOException
IOException
public int getMaxFieldLength()
public void setMaxFieldLength(int maxFieldLength)
public Similarity getSimilarity()
public void setSimilarity(Similarity similarity)
public Analyzer getAnalyzer()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |