|
|||||||||
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 forceMerge in the end, may flush by doc count instead of RAM, etc.
Field Summary | |
---|---|
IndexWriter |
w
|
Constructor Summary | |
---|---|
RandomIndexWriter(Random r,
Directory dir)
create a RandomIndexWriter with a random config: Uses TEST_VERSION_CURRENT and MockAnalyzer |
|
RandomIndexWriter(Random r,
Directory dir,
Analyzer a)
create a RandomIndexWriter with a random config: Uses TEST_VERSION_CURRENT |
|
RandomIndexWriter(Random r,
Directory dir,
IndexWriterConfig c)
create a RandomIndexWriter with the provided config |
|
RandomIndexWriter(Random r,
Directory dir,
Version v,
Analyzer a)
create a RandomIndexWriter with a random config |
Method Summary | ||
---|---|---|
|
addDocument(Iterable<T> doc)
Adds a Document. |
|
|
addDocument(Iterable<T> doc,
Analyzer a)
|
|
void |
addDocuments(Iterable<? extends Iterable<? extends IndexableField>> docs)
|
|
void |
addIndexes(Directory... dirs)
|
|
void |
addIndexes(IndexReader... readers)
|
|
void |
close()
Close this writer. |
|
void |
commit()
|
|
void |
deleteAll()
|
|
void |
deleteDocuments(Query q)
|
|
void |
deleteDocuments(Term term)
|
|
void |
forceMerge(int maxSegmentCount)
Forces a forceMerge. |
|
void |
forceMergeDeletes()
|
|
void |
forceMergeDeletes(boolean doWait)
|
|
DirectoryReader |
getReader()
|
|
DirectoryReader |
getReader(boolean applyDeletions)
|
|
int |
maxDoc()
|
|
int |
numDocs()
|
|
void |
setDoRandomForceMerge(boolean v)
|
|
void |
setDoRandomForceMergeAssert(boolean v)
|
|
|
updateDocument(Term t,
Iterable<T> doc)
Updates a document. |
|
void |
updateDocuments(Term delTerm,
Iterable<? extends Iterable<? extends IndexableField>> docs)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public IndexWriter w
Constructor Detail |
---|
public RandomIndexWriter(Random r, Directory dir) throws IOException
IOException
public RandomIndexWriter(Random r, Directory dir, Analyzer a) throws IOException
IOException
public RandomIndexWriter(Random r, Directory dir, Version v, Analyzer a) throws IOException
IOException
public RandomIndexWriter(Random r, Directory dir, IndexWriterConfig c) throws IOException
IOException
Method Detail |
---|
public <T extends IndexableField> void addDocument(Iterable<T> doc) throws IOException
IOException
IndexWriter.addDocument(Iterable)
public <T extends IndexableField> void addDocument(Iterable<T> doc, Analyzer a) throws IOException
IOException
public void addDocuments(Iterable<? extends Iterable<? extends IndexableField>> docs) throws IOException
IOException
public void updateDocuments(Term delTerm, Iterable<? extends Iterable<? extends IndexableField>> docs) throws IOException
IOException
public <T extends IndexableField> void updateDocument(Term t, Iterable<T> doc) throws IOException
IOException
IndexWriter.updateDocument(Term, Iterable)
public void addIndexes(Directory... dirs) throws IOException
IOException
public void addIndexes(IndexReader... readers) throws IOException
IOException
public void deleteDocuments(Term term) throws IOException
IOException
public void deleteDocuments(Query q) throws IOException
IOException
public void commit() throws IOException
IOException
public int numDocs()
public int maxDoc()
public void deleteAll() throws IOException
IOException
public DirectoryReader getReader() throws IOException
IOException
public void forceMergeDeletes(boolean doWait) throws IOException
IOException
public void forceMergeDeletes() throws IOException
IOException
public void setDoRandomForceMerge(boolean v)
public void setDoRandomForceMergeAssert(boolean v)
public DirectoryReader getReader(boolean applyDeletions) throws IOException
IOException
public void close() throws IOException
close
in interface Closeable
IOException
IndexWriter.close()
public void forceMerge(int maxSegmentCount) throws IOException
NOTE: this should be avoided in tests unless absolutely necessary, as it will result in less test coverage.
IOException
IndexWriter.forceMerge(int)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |