Package org.apache.lucene.search
Class NRTManager.TrackingIndexWriter
- java.lang.Object
-
- org.apache.lucene.search.NRTManager.TrackingIndexWriter
-
- Enclosing class:
- NRTManager
public static class NRTManager.TrackingIndexWriter extends Object
Class that tracks changes to a delegated IndexWriter. Create this class (passing your IndexWriter), and then pass this class to NRTManager. Be sure to make all changes via the TrackingIndexWriter, otherwise NRTManager won't know about the changes.- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
-
Constructor Summary
Constructors Constructor Description TrackingIndexWriter(IndexWriter writer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
addDocument(Document d)
long
addDocument(Document d, Analyzer a)
long
addDocuments(Collection<Document> docs)
long
addDocuments(Collection<Document> docs, Analyzer a)
long
addIndexes(IndexReader... readers)
long
addIndexes(Directory... dirs)
long
deleteAll()
long
deleteDocuments(Term t)
long
deleteDocuments(Term... terms)
long
deleteDocuments(Query q)
long
deleteDocuments(Query... queries)
long
getGeneration()
IndexWriter
getIndexWriter()
long
updateDocument(Term t, Document d)
long
updateDocument(Term t, Document d, Analyzer a)
long
updateDocuments(Term t, Collection<Document> docs)
long
updateDocuments(Term t, Collection<Document> docs, Analyzer a)
-
-
-
Constructor Detail
-
TrackingIndexWriter
public TrackingIndexWriter(IndexWriter writer)
-
-
Method Detail
-
updateDocument
public long updateDocument(Term t, Document d, Analyzer a) throws IOException
- Throws:
IOException
-
updateDocument
public long updateDocument(Term t, Document d) throws IOException
- Throws:
IOException
-
updateDocuments
public long updateDocuments(Term t, Collection<Document> docs, Analyzer a) throws IOException
- Throws:
IOException
-
updateDocuments
public long updateDocuments(Term t, Collection<Document> docs) throws IOException
- Throws:
IOException
-
deleteDocuments
public long deleteDocuments(Term t) throws IOException
- Throws:
IOException
-
deleteDocuments
public long deleteDocuments(Term... terms) throws IOException
- Throws:
IOException
-
deleteDocuments
public long deleteDocuments(Query q) throws IOException
- Throws:
IOException
-
deleteDocuments
public long deleteDocuments(Query... queries) throws IOException
- Throws:
IOException
-
deleteAll
public long deleteAll() throws IOException
- Throws:
IOException
-
addDocument
public long addDocument(Document d, Analyzer a) throws IOException
- Throws:
IOException
-
addDocuments
public long addDocuments(Collection<Document> docs, Analyzer a) throws IOException
- Throws:
IOException
-
addDocument
public long addDocument(Document d) throws IOException
- Throws:
IOException
-
addDocuments
public long addDocuments(Collection<Document> docs) throws IOException
- Throws:
IOException
-
addIndexes
public long addIndexes(Directory... dirs) throws CorruptIndexException, IOException
- Throws:
CorruptIndexException
IOException
-
addIndexes
public long addIndexes(IndexReader... readers) throws CorruptIndexException, IOException
- Throws:
CorruptIndexException
IOException
-
getGeneration
public long getGeneration()
-
getIndexWriter
public IndexWriter getIndexWriter()
-
-