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 aTrackingIndexWriterwrapping the providedIndexWriter. -
Method Summary
Modifier and TypeMethodDescriptionlongaddDocument(Iterable<? extends IndexableField> d) CallsIndexWriter.addDocument(Iterable)and returns the generation that reflects this change.longaddDocument(Iterable<? extends IndexableField> d, Analyzer a) CallsIndexWriter.addDocument(Iterable,Analyzer)and returns the generation that reflects this change.longaddDocuments(Iterable<? extends Iterable<? extends IndexableField>> docs) CallsIndexWriter.addDocuments(Iterable)and returns the generation that reflects this change.longaddDocuments(Iterable<? extends Iterable<? extends IndexableField>> docs, Analyzer a) CallsIndexWriter.addDocuments(Iterable,Analyzer)and returns the generation that reflects this change.longaddIndexes(IndexReader... readers) CallsIndexWriter.addIndexes(IndexReader...)and returns the generation that reflects this change.longaddIndexes(Directory... dirs) CallsIndexWriter.addIndexes(Directory...)and returns the generation that reflects this change.longCallsIndexWriter.deleteAll()and returns the generation that reflects this change.longCallsIndexWriter.deleteDocuments(Term)and returns the generation that reflects this change.longdeleteDocuments(Term... terms) CallsIndexWriter.deleteDocuments(Term...)and returns the generation that reflects this change.longCallsIndexWriter.deleteDocuments(Query)and returns the generation that reflects this change.longdeleteDocuments(Query... queries) CallsIndexWriter.deleteDocuments(Query...)and returns the generation that reflects this change.longReturn and increment current gen.longReturn the current generation being indexed.Return the wrappedIndexWriter.longtryDeleteDocument(IndexReader reader, int docID) CalsIndexWriter.tryDeleteDocument(IndexReader,int)and returns the generation that reflects this change.longupdateDocument(Term t, Iterable<? extends IndexableField> d) CallsIndexWriter.updateDocument(Term,Iterable)and returns the generation that reflects this change.longupdateDocument(Term t, Iterable<? extends IndexableField> d, Analyzer a) CallsIndexWriter.updateDocument(Term,Iterable,Analyzer)and returns the generation that reflects this change.longupdateDocuments(Term t, Iterable<? extends Iterable<? extends IndexableField>> docs) CallsIndexWriter.updateDocuments(Term,Iterable)and returns the generation that reflects this change.longupdateDocuments(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 aTrackingIndexWriterwrapping 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
-