Class CachedOrdinalsReader
A per-segment cache of documents' facet ordinals. Every CachedOrdinalsReader.CachedOrds holds the ordinals in a raw int[], and therefore consumes as much RAM as the total number of ordinals found in the segment, but saves the CPU cost of decoding ordinals during facet counting.
NOTE: every CachedOrdinalsReader.CachedOrds is limited to 2.1B total ordinals. If that is a limitation for you then consider limiting the segment size to fewer documents, or use an alternative cache which pages through the category ordinals.
NOTE: when using this cache, it is advised to use a Lucene.Net.Codecs.DocValuesFormat that does not cache the data in memory, at least for the category lists fields, or otherwise you'll be doing double-caching.
NOTE: create one instance of this and re-use it for all facet implementations (the cache is per-instance, not static).
Implements
Inherited Members
Namespace: Lucene.Net.Facet.Taxonomy
Assembly: Lucene.Net.Facet.dll
Syntax
public class CachedOrdinalsReader : OrdinalsReader, IAccountable
Constructors
CachedOrdinalsReader(OrdinalsReader)
Sole constructor.
Declaration
public CachedOrdinalsReader(OrdinalsReader source)
Parameters
Type | Name | Description |
---|---|---|
OrdinalsReader | source |
Properties
IndexFieldName
Returns the indexed field name this OrdinalsReader is reading from.
Declaration
public override string IndexFieldName { get; }
Property Value
Type | Description |
---|---|
string |
Overrides
Methods
GetReader(AtomicReaderContext)
Set current atomic reader.
Declaration
public override OrdinalsReader.OrdinalsSegmentReader GetReader(AtomicReaderContext context)
Parameters
Type | Name | Description |
---|---|---|
AtomicReaderContext | context |
Returns
Type | Description |
---|---|
OrdinalsReader.OrdinalsSegmentReader |
Overrides
RamBytesUsed()
Return the memory usage of this object in bytes. Negative values are illegal.
Declaration
public virtual long RamBytesUsed()
Returns
Type | Description |
---|---|
long |