Package org.apache.lucene.index
Class TrackingIndexWriter
java.lang.Object
org.apache.lucene.index.TrackingIndexWriter
Class that tracks changes to a delegated
IndexWriter, used by
ControlledRealTimeReopenThread
to ensure specific
changes are visible. Create this class (passing your
IndexWriter), and then pass this class to ControlledRealTimeReopenThread
.
Be sure to make all changes via the
TrackingIndexWriter, otherwise ControlledRealTimeReopenThread
won't know about the changes.-
Constructor Summary
ConstructorsConstructorDescriptionTrackingIndexWriter
(IndexWriter writer) Create aTrackingIndexWriter
wrapping the providedIndexWriter
. -
Method Summary
Modifier and TypeMethodDescriptionlong
addDocument
(Iterable<? extends IndexableField> d) CallsIndexWriter.addDocument(Iterable)
and returns the generation that reflects this change.long
addDocument
(Iterable<? extends IndexableField> d, Analyzer a) CallsIndexWriter.addDocument(Iterable,Analyzer)
and returns the generation that reflects this change.long
addDocuments
(Iterable<? extends Iterable<? extends IndexableField>> docs) CallsIndexWriter.addDocuments(Iterable)
and returns the generation that reflects this change.long
addDocuments
(Iterable<? extends Iterable<? extends IndexableField>> docs, Analyzer a) CallsIndexWriter.addDocuments(Iterable,Analyzer)
and returns the generation that reflects this change.long
addIndexes
(IndexReader... readers) CallsIndexWriter.addIndexes(IndexReader...)
and returns the generation that reflects this change.long
addIndexes
(Directory... dirs) CallsIndexWriter.addIndexes(Directory...)
and returns the generation that reflects this change.long
CallsIndexWriter.deleteAll()
and returns the generation that reflects this change.long
CallsIndexWriter.deleteDocuments(Term)
and returns the generation that reflects this change.long
deleteDocuments
(Term... terms) CallsIndexWriter.deleteDocuments(Term...)
and returns the generation that reflects this change.long
CallsIndexWriter.deleteDocuments(Query)
and returns the generation that reflects this change.long
deleteDocuments
(Query... queries) CallsIndexWriter.deleteDocuments(Query...)
and returns the generation that reflects this change.long
Return and increment current gen.long
Return the current generation being indexed.Return the wrappedIndexWriter
.long
tryDeleteDocument
(IndexReader reader, int docID) CalsIndexWriter.tryDeleteDocument(IndexReader,int)
and returns the generation that reflects this change.long
updateDocument
(Term t, Iterable<? extends IndexableField> d) CallsIndexWriter.updateDocument(Term,Iterable)
and returns the generation that reflects this change.long
updateDocument
(Term t, Iterable<? extends IndexableField> d, Analyzer a) CallsIndexWriter.updateDocument(Term,Iterable,Analyzer)
and returns the generation that reflects this change.long
updateDocuments
(Term t, Iterable<? extends Iterable<? extends IndexableField>> docs) CallsIndexWriter.updateDocuments(Term,Iterable)
and returns the generation that reflects this change.long
updateDocuments
(Term t, Iterable<? extends Iterable<? extends IndexableField>> docs, Analyzer a) CallsIndexWriter.updateDocuments(Term,Iterable,Analyzer)
and returns the generation that reflects this change.
-
Constructor Details
-
TrackingIndexWriter
Create aTrackingIndexWriter
wrapping the providedIndexWriter
.
-
-
Method Details
-
updateDocument
public long updateDocument(Term t, Iterable<? extends IndexableField> d, Analyzer a) throws IOException CallsIndexWriter.updateDocument(Term,Iterable,Analyzer)
and returns the generation that reflects this change.- Throws:
IOException
-
updateDocument
CallsIndexWriter.updateDocument(Term,Iterable)
and returns the generation that reflects this change.- Throws:
IOException
-
updateDocuments
public long updateDocuments(Term t, Iterable<? extends Iterable<? extends IndexableField>> docs, Analyzer a) throws IOException CallsIndexWriter.updateDocuments(Term,Iterable,Analyzer)
and returns the generation that reflects this change.- Throws:
IOException
-
updateDocuments
public long updateDocuments(Term t, Iterable<? extends Iterable<? extends IndexableField>> docs) throws IOException CallsIndexWriter.updateDocuments(Term,Iterable)
and returns the generation that reflects this change.- Throws:
IOException
-
deleteDocuments
CallsIndexWriter.deleteDocuments(Term)
and returns the generation that reflects this change.- Throws:
IOException
-
deleteDocuments
CallsIndexWriter.deleteDocuments(Term...)
and returns the generation that reflects this change.- Throws:
IOException
-
deleteDocuments
CallsIndexWriter.deleteDocuments(Query)
and returns the generation that reflects this change.- Throws:
IOException
-
deleteDocuments
CallsIndexWriter.deleteDocuments(Query...)
and returns the generation that reflects this change.- Throws:
IOException
-
deleteAll
CallsIndexWriter.deleteAll()
and returns the generation that reflects this change.- Throws:
IOException
-
addDocument
CallsIndexWriter.addDocument(Iterable,Analyzer)
and returns the generation that reflects this change.- Throws:
IOException
-
addDocuments
public long addDocuments(Iterable<? extends Iterable<? extends IndexableField>> docs, Analyzer a) throws IOException CallsIndexWriter.addDocuments(Iterable,Analyzer)
and returns the generation that reflects this change.- Throws:
IOException
-
addDocument
CallsIndexWriter.addDocument(Iterable)
and returns the generation that reflects this change.- Throws:
IOException
-
addDocuments
public long addDocuments(Iterable<? extends Iterable<? extends IndexableField>> docs) throws IOException CallsIndexWriter.addDocuments(Iterable)
and returns the generation that reflects this change.- Throws:
IOException
-
addIndexes
CallsIndexWriter.addIndexes(Directory...)
and returns the generation that reflects this change.- Throws:
IOException
-
addIndexes
CallsIndexWriter.addIndexes(IndexReader...)
and returns the generation that reflects this change.- Throws:
IOException
-
getGeneration
public long getGeneration()Return the current generation being indexed. -
getIndexWriter
Return the wrappedIndexWriter
. -
getAndIncrementGeneration
public long getAndIncrementGeneration()Return and increment current gen. -
tryDeleteDocument
CalsIndexWriter.tryDeleteDocument(IndexReader,int)
and returns the generation that reflects this change.- Throws:
IOException
-