Class TrackingIndexWriter
Class that tracks changes to a delegated IndexWriter, used by ControlledRealTimeReopenThread<T> to ensure specific changes are visible. Create this class (passing your IndexWriter), and then pass this class to ControlledRealTimeReopenThread<T>. Be sure to make all changes via the TrackingIndexWriter, otherwise ControlledRealTimeReopenThread<T> won't know about the changes.
Note
This API is experimental and might change in incompatible ways in the next release.
Inherited Members
Namespace: Lucene.Net.Index
Assembly: Lucene.Net.dll
Syntax
public class TrackingIndexWriter
Constructors
TrackingIndexWriter(IndexWriter)
Create a TrackingIndexWriter wrapping the provided IndexWriter.
Declaration
public TrackingIndexWriter(IndexWriter writer)
Parameters
Type | Name | Description |
---|---|---|
IndexWriter | writer |
Properties
Generation
Return the current generation being indexed.
Declaration
public virtual long Generation { get; }
Property Value
Type | Description |
---|---|
long |
IndexWriter
Return the wrapped IndexWriter.
Declaration
public virtual IndexWriter IndexWriter { get; }
Property Value
Type | Description |
---|---|
IndexWriter |
Methods
AddDocument(IEnumerable<IIndexableField>)
Calls AddDocument(IEnumerable<IIndexableField>) and returns the generation that reflects this change.
Declaration
public virtual long AddDocument(IEnumerable<IIndexableField> d)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<IIndexableField> | d |
Returns
Type | Description |
---|---|
long |
AddDocument(IEnumerable<IIndexableField>, Analyzer)
Calls AddDocument(IEnumerable<IIndexableField>, Analyzer) and returns the generation that reflects this change.
Declaration
public virtual long AddDocument(IEnumerable<IIndexableField> d, Analyzer a)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<IIndexableField> | d | |
Analyzer | a |
Returns
Type | Description |
---|---|
long |
AddDocuments(IEnumerable<IEnumerable<IIndexableField>>)
Calls AddDocuments(IEnumerable<IEnumerable<IIndexableField>>) and returns the generation that reflects this change.
Declaration
public virtual long AddDocuments(IEnumerable<IEnumerable<IIndexableField>> docs)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<IEnumerable<IIndexableField>> | docs |
Returns
Type | Description |
---|---|
long |
AddDocuments(IEnumerable<IEnumerable<IIndexableField>>, Analyzer)
Calls AddDocuments(IEnumerable<IEnumerable<IIndexableField>>, Analyzer) and returns the generation that reflects this change.
Declaration
public virtual long AddDocuments(IEnumerable<IEnumerable<IIndexableField>> docs, Analyzer a)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<IEnumerable<IIndexableField>> | docs | |
Analyzer | a |
Returns
Type | Description |
---|---|
long |
AddIndexes(params IndexReader[])
Calls AddIndexes(params IndexReader[]) and returns the generation that reflects this change.
Declaration
public virtual long AddIndexes(params IndexReader[] readers)
Parameters
Type | Name | Description |
---|---|---|
IndexReader[] | readers |
Returns
Type | Description |
---|---|
long |
AddIndexes(params Directory[])
Calls AddIndexes(params Directory[]) and returns the generation that reflects this change.
Declaration
public virtual long AddIndexes(params Directory[] dirs)
Parameters
Type | Name | Description |
---|---|---|
Directory[] | dirs |
Returns
Type | Description |
---|---|
long |
DeleteAll()
Calls DeleteAll() and returns the generation that reflects this change.
Declaration
public virtual long DeleteAll()
Returns
Type | Description |
---|---|
long |
DeleteDocuments(Term)
Calls DeleteDocuments(Term) and returns the generation that reflects this change.
Declaration
public virtual long DeleteDocuments(Term t)
Parameters
Type | Name | Description |
---|---|---|
Term | t |
Returns
Type | Description |
---|---|
long |
DeleteDocuments(params Term[])
Calls DeleteDocuments(params Term[]) and returns the generation that reflects this change.
Declaration
public virtual long DeleteDocuments(params Term[] terms)
Parameters
Type | Name | Description |
---|---|---|
Term[] | terms |
Returns
Type | Description |
---|---|
long |
DeleteDocuments(Query)
Calls DeleteDocuments(Query) and returns the generation that reflects this change.
Declaration
public virtual long DeleteDocuments(Query q)
Parameters
Type | Name | Description |
---|---|---|
Query | q |
Returns
Type | Description |
---|---|
long |
DeleteDocuments(params Query[])
Calls DeleteDocuments(params Query[]) and returns the generation that reflects this change.
Declaration
public virtual long DeleteDocuments(params Query[] queries)
Parameters
Type | Name | Description |
---|---|---|
Query[] | queries |
Returns
Type | Description |
---|---|
long |
GetAndIncrementGeneration()
Return and increment current gen.
Note
This API is for internal purposes only and might change in incompatible ways in the next release.
Declaration
public virtual long GetAndIncrementGeneration()
Returns
Type | Description |
---|---|
long |
TryDeleteDocument(IndexReader, int)
Cals TryDeleteDocument(IndexReader, int) and returns the generation that reflects this change.
Declaration
public virtual long TryDeleteDocument(IndexReader reader, int docID)
Parameters
Type | Name | Description |
---|---|---|
IndexReader | reader | |
int | docID |
Returns
Type | Description |
---|---|
long |
UpdateDocument(Term, IEnumerable<IIndexableField>)
Calls UpdateDocument(Term, IEnumerable<IIndexableField>) and returns the generation that reflects this change.
Declaration
public virtual long UpdateDocument(Term t, IEnumerable<IIndexableField> d)
Parameters
Type | Name | Description |
---|---|---|
Term | t | |
IEnumerable<IIndexableField> | d |
Returns
Type | Description |
---|---|
long |
UpdateDocument(Term, IEnumerable<IIndexableField>, Analyzer)
Calls UpdateDocument(Term, IEnumerable<IIndexableField>, Analyzer) and returns the generation that reflects this change.
Declaration
public virtual long UpdateDocument(Term t, IEnumerable<IIndexableField> d, Analyzer a)
Parameters
Type | Name | Description |
---|---|---|
Term | t | |
IEnumerable<IIndexableField> | d | |
Analyzer | a |
Returns
Type | Description |
---|---|
long |
UpdateDocuments(Term, IEnumerable<IEnumerable<IIndexableField>>)
Calls UpdateDocuments(Term, IEnumerable<IEnumerable<IIndexableField>>) and returns the generation that reflects this change.
Declaration
public virtual long UpdateDocuments(Term t, IEnumerable<IEnumerable<IIndexableField>> docs)
Parameters
Type | Name | Description |
---|---|---|
Term | t | |
IEnumerable<IEnumerable<IIndexableField>> | docs |
Returns
Type | Description |
---|---|
long |
UpdateDocuments(Term, IEnumerable<IEnumerable<IIndexableField>>, Analyzer)
Calls UpdateDocuments(Term, IEnumerable<IEnumerable<IIndexableField>>, Analyzer) and returns the generation that reflects this change.
Declaration
public virtual long UpdateDocuments(Term t, IEnumerable<IEnumerable<IIndexableField>> docs, Analyzer a)
Parameters
Type | Name | Description |
---|---|---|
Term | t | |
IEnumerable<IEnumerable<IIndexableField>> | docs | |
Analyzer | a |
Returns
Type | Description |
---|---|
long |