|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.index.RandomIndexWriter
public class RandomIndexWriter
Silly class that randomizes the indexing experience. EG it may swap in a different merge policy/scheduler; may commit periodically; may or may not optimize in the end, may flush by doc count instead of RAM, etc.
Field Summary | |
---|---|
org.apache.lucene.index.IndexWriter |
w
|
Constructor Summary | |
---|---|
RandomIndexWriter(Random r,
org.apache.lucene.store.Directory dir)
create a RandomIndexWriter with a random config: Uses TEST_VERSION_CURRENT and Whitespace+LowercasingAnalyzer |
|
RandomIndexWriter(Random r,
org.apache.lucene.store.Directory dir,
org.apache.lucene.analysis.Analyzer a)
create a RandomIndexWriter with a random config: Uses TEST_VERSION_CURRENT |
|
RandomIndexWriter(Random r,
org.apache.lucene.store.Directory dir,
org.apache.lucene.index.IndexWriterConfig c)
create a RandomIndexWriter with the provided config |
|
RandomIndexWriter(Random r,
org.apache.lucene.store.Directory dir,
org.apache.lucene.util.Version v,
org.apache.lucene.analysis.Analyzer a)
create a RandomIndexWriter with a random config |
Method Summary | |
---|---|
void |
addDocument(org.apache.lucene.document.Document doc)
Adds a Document. |
void |
addDocuments(Collection<org.apache.lucene.document.Document> docs)
|
void |
addIndexes(org.apache.lucene.store.Directory... dirs)
|
void |
close()
Close this writer. |
void |
commit()
|
void |
deleteAll()
|
void |
deleteDocuments(org.apache.lucene.index.Term term)
|
org.apache.lucene.index.IndexReader |
getReader()
|
org.apache.lucene.index.IndexReader |
getReader(boolean applyDeletions)
|
int |
maxDoc()
|
int |
numDocs()
|
void |
optimize()
Forces an optimize. |
void |
setDoRandomOptimize(boolean v)
|
void |
updateDocument(org.apache.lucene.index.Term t,
org.apache.lucene.document.Document doc)
Updates a document. |
void |
updateDocuments(org.apache.lucene.index.Term delTerm,
Collection<org.apache.lucene.document.Document> docs)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public org.apache.lucene.index.IndexWriter w
Constructor Detail |
---|
public RandomIndexWriter(Random r, org.apache.lucene.store.Directory dir) throws IOException
IOException
public RandomIndexWriter(Random r, org.apache.lucene.store.Directory dir, org.apache.lucene.analysis.Analyzer a) throws IOException
IOException
public RandomIndexWriter(Random r, org.apache.lucene.store.Directory dir, org.apache.lucene.util.Version v, org.apache.lucene.analysis.Analyzer a) throws IOException
IOException
public RandomIndexWriter(Random r, org.apache.lucene.store.Directory dir, org.apache.lucene.index.IndexWriterConfig c) throws IOException
IOException
Method Detail |
---|
public void addDocument(org.apache.lucene.document.Document doc) throws IOException
IOException
IndexWriter.addDocument(Document)
public void addDocuments(Collection<org.apache.lucene.document.Document> docs) throws IOException
IOException
public void updateDocuments(org.apache.lucene.index.Term delTerm, Collection<org.apache.lucene.document.Document> docs) throws IOException
IOException
public void updateDocument(org.apache.lucene.index.Term t, org.apache.lucene.document.Document doc) throws IOException
IOException
IndexWriter.updateDocument(Term, Document)
public void addIndexes(org.apache.lucene.store.Directory... dirs) throws org.apache.lucene.index.CorruptIndexException, IOException
org.apache.lucene.index.CorruptIndexException
IOException
public void deleteDocuments(org.apache.lucene.index.Term term) throws org.apache.lucene.index.CorruptIndexException, IOException
org.apache.lucene.index.CorruptIndexException
IOException
public void commit() throws org.apache.lucene.index.CorruptIndexException, IOException
org.apache.lucene.index.CorruptIndexException
IOException
public int numDocs() throws IOException
IOException
public int maxDoc()
public void deleteAll() throws IOException
IOException
public void setDoRandomOptimize(boolean v)
public org.apache.lucene.index.IndexReader getReader() throws IOException
IOException
public org.apache.lucene.index.IndexReader getReader(boolean applyDeletions) throws IOException
IOException
public void close() throws IOException
close
in interface Closeable
IOException
IndexWriter.close()
public void optimize() throws IOException
NOTE: this should be avoided in tests unless absolutely necessary, as it will result in less test coverage.
IOException
IndexWriter.optimize()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |