public class TrackingIndexWriter extends Object
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 and Description | 
|---|
TrackingIndexWriter(IndexWriter writer)
Create a  
TrackingIndexWriter wrapping the
  provided IndexWriter. | 
| Modifier and Type | Method and Description | 
|---|---|
long | 
addDocument(Iterable<? extends IndexableField> d)
Calls  
IndexWriter.addDocument(Iterable)
  and returns the generation that reflects this change. | 
long | 
addDocument(Iterable<? extends IndexableField> d,
           Analyzer a)
Deprecated. 
 
This will be removed in 5.0.0. 
 | 
long | 
addDocuments(Iterable<? extends Iterable<? extends IndexableField>> docs)
Calls  
IndexWriter.addDocuments(Iterable) and
  returns the generation that reflects this change. | 
long | 
addDocuments(Iterable<? extends Iterable<? extends IndexableField>> docs,
            Analyzer a)
Deprecated. 
 
This will be removed in 5.0.0. 
 | 
long | 
addIndexes(Directory... dirs)
Calls  
IndexWriter.addIndexes(Directory...) and
  returns the generation that reflects this change. | 
long | 
addIndexes(IndexReader... readers)
Calls  
IndexWriter.addIndexes(IndexReader...)
  and returns the generation that reflects this change. | 
long | 
deleteAll()
Calls  
IndexWriter.deleteAll() and returns the
  generation that reflects this change. | 
long | 
deleteDocuments(Query... queries)
Calls  
IndexWriter.deleteDocuments(Query...)
  and returns the generation that reflects this change. | 
long | 
deleteDocuments(Query q)
Calls  
IndexWriter.deleteDocuments(Query...) and
  returns the generation that reflects this change. | 
long | 
deleteDocuments(Term... terms)
Calls  
IndexWriter.deleteDocuments(Term...) and
  returns the generation that reflects this change. | 
long | 
deleteDocuments(Term t)
Calls  
IndexWriter.deleteDocuments(Term...) and
  returns the generation that reflects this change. | 
long | 
getAndIncrementGeneration()
Return and increment current gen. 
 | 
long | 
getGeneration()
Return the current generation being indexed. 
 | 
IndexWriter | 
getIndexWriter()
Return the wrapped  
IndexWriter. | 
long | 
tryDeleteDocument(IndexReader reader,
                 int docID)
Cals  
IndexWriter.tryDeleteDocument(IndexReader,int) and
  returns the generation that reflects this change. | 
long | 
updateDocument(Term t,
              Iterable<? extends IndexableField> d)
Calls  
IndexWriter.updateDocument(Term,Iterable) and
  returns the generation that reflects this change. | 
long | 
updateDocument(Term t,
              Iterable<? extends IndexableField> d,
              Analyzer a)
Deprecated. 
 
This will be removed in 5.0.0. 
 | 
long | 
updateDocuments(Term t,
               Iterable<? extends Iterable<? extends IndexableField>> docs)
Calls  
IndexWriter.updateDocuments(Term,Iterable) and returns
  the generation that reflects this change. | 
long | 
updateDocuments(Term t,
               Iterable<? extends Iterable<? extends IndexableField>> docs,
               Analyzer a)
Deprecated. 
 
This will be removed in 5.0.0. 
 | 
public TrackingIndexWriter(IndexWriter writer)
TrackingIndexWriter wrapping the
  provided IndexWriter.@Deprecated public long updateDocument(Term t, Iterable<? extends IndexableField> d, Analyzer a) throws IOException
IndexWriter.updateDocument(Term,Iterable,Analyzer)
  and returns the generation that reflects this change.IOExceptionpublic long updateDocument(Term t, Iterable<? extends IndexableField> d) throws IOException
IndexWriter.updateDocument(Term,Iterable) and
  returns the generation that reflects this change.IOException@Deprecated public long updateDocuments(Term t, Iterable<? extends Iterable<? extends IndexableField>> docs, Analyzer a) throws IOException
IndexWriter.updateDocuments(Term,Iterable,Analyzer)
  and returns the generation that reflects this change.IOExceptionpublic long updateDocuments(Term t, Iterable<? extends Iterable<? extends IndexableField>> docs) throws IOException
IndexWriter.updateDocuments(Term,Iterable) and returns
  the generation that reflects this change.IOExceptionpublic long deleteDocuments(Term t) throws IOException
IndexWriter.deleteDocuments(Term...) and
  returns the generation that reflects this change.IOExceptionpublic long deleteDocuments(Term... terms) throws IOException
IndexWriter.deleteDocuments(Term...) and
  returns the generation that reflects this change.IOExceptionpublic long deleteDocuments(Query q) throws IOException
IndexWriter.deleteDocuments(Query...) and
  returns the generation that reflects this change.IOExceptionpublic long deleteDocuments(Query... queries) throws IOException
IndexWriter.deleteDocuments(Query...)
  and returns the generation that reflects this change.IOExceptionpublic long deleteAll()
               throws IOException
IndexWriter.deleteAll() and returns the
  generation that reflects this change.IOException@Deprecated public long addDocument(Iterable<? extends IndexableField> d, Analyzer a) throws IOException
IndexWriter.addDocument(Iterable,Analyzer) and
  returns the generation that reflects this change.IOException@Deprecated public long addDocuments(Iterable<? extends Iterable<? extends IndexableField>> docs, Analyzer a) throws IOException
IndexWriter.addDocuments(Iterable,Analyzer) and
  returns the generation that reflects this change.IOExceptionpublic long addDocument(Iterable<? extends IndexableField> d) throws IOException
IndexWriter.addDocument(Iterable)
  and returns the generation that reflects this change.IOExceptionpublic long addDocuments(Iterable<? extends Iterable<? extends IndexableField>> docs) throws IOException
IndexWriter.addDocuments(Iterable) and
  returns the generation that reflects this change.IOExceptionpublic long addIndexes(Directory... dirs) throws IOException
IndexWriter.addIndexes(Directory...) and
  returns the generation that reflects this change.IOExceptionpublic long addIndexes(IndexReader... readers) throws IOException
IndexWriter.addIndexes(IndexReader...)
  and returns the generation that reflects this change.IOExceptionpublic long getGeneration()
public IndexWriter getIndexWriter()
IndexWriter.public long getAndIncrementGeneration()
public long tryDeleteDocument(IndexReader reader, int docID) throws IOException
IndexWriter.tryDeleteDocument(IndexReader,int) and
  returns the generation that reflects this change.IOExceptionCopyright © 2000-2015 Apache Software Foundation. All Rights Reserved.