Class LiveFieldValues<S, T>
Tracks live field values across NRT reader reopens.
This holds a map for all updated ids since
the last reader reopen. Once the NRT reader is reopened,
it prunes the map. This means you must reopen your NRT
reader periodically otherwise the RAM consumption of
this class will grow unbounded!
NOTE: you must ensure the same id is never updated at
the same time by two threads, because in this case you
cannot in general know which thread "won".
Inheritance
System.Object
LiveFieldValues<S, T>
Implements
System.IDisposable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: Lucene.Net.dll
Syntax
public abstract class LiveFieldValues<S, T> : ReferenceManager.IRefreshListener, IDisposable where S : class
Type Parameters
Constructors
|
Improve this Doc
View Source
LiveFieldValues(ReferenceManager<S>, T)
Declaration
public LiveFieldValues(ReferenceManager<S> mgr, T missingValue)
Parameters
Properties
|
Improve this Doc
View Source
Count
Returns the [approximate] number of id/value pairs
buffered in RAM.
NOTE: This was size() in Lucene.
Declaration
public virtual int Count { get; }
Property Value
Type |
Description |
System.Int32 |
|
Methods
|
Improve this Doc
View Source
Add(String, T)
Call this after you've successfully added a document
to the index, to record what value you just set the
field to.
Declaration
public virtual void Add(string id, T value)
Parameters
Type |
Name |
Description |
System.String |
id |
|
T |
value |
|
|
Improve this Doc
View Source
AfterRefresh(Boolean)
Declaration
public virtual void AfterRefresh(bool didRefresh)
Parameters
Type |
Name |
Description |
System.Boolean |
didRefresh |
|
|
Improve this Doc
View Source
BeforeRefresh()
Declaration
public virtual void BeforeRefresh()
|
Improve this Doc
View Source
Delete(String)
Call this after you've successfully deleted a document
from the index.
Declaration
public virtual void Delete(string id)
Parameters
Type |
Name |
Description |
System.String |
id |
|
|
Improve this Doc
View Source
Dispose()
Declaration
|
Improve this Doc
View Source
Get(String)
Returns the current value for this id, or null
if the
id isn't in the index or was deleted.
Declaration
public virtual T Get(string id)
Parameters
Type |
Name |
Description |
System.String |
id |
|
Returns
|
Improve this Doc
View Source
LookupFromSearcher(S, String)
This is called when the id/value was already flushed & opened
in an NRT IndexSearcher. You must implement this to
go look up the value (eg, via doc values, field cache,
stored fields, etc.).
Declaration
protected abstract T LookupFromSearcher(S s, string id)
Parameters
Type |
Name |
Description |
S |
s |
|
System.String |
id |
|
Returns
Implements
System.IDisposable