java.lang.Object
org.apache.lucene.facet.taxonomy.OrdinalsReader
org.apache.lucene.facet.taxonomy.CachedOrdinalsReader
- All Implemented Interfaces:
Accountable
Deprecated.
Custom binary encodings for taxonomy ordinals are no longer supported starting with
Lucene 9
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 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).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Deprecated.Holds the cached ordinals in two parallelint[]
arrays.Nested classes/interfaces inherited from class org.apache.lucene.facet.taxonomy.OrdinalsReader
OrdinalsReader.OrdinalsSegmentReader
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map
<Object, CachedOrdinalsReader.CachedOrds> Deprecated.private final OrdinalsReader
Deprecated.Fields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate CachedOrdinalsReader.CachedOrds
getCachedOrds
(LeafReaderContext context) Deprecated.Deprecated.Returns nested resources of this class.Deprecated.Returns the indexed field name thisOrdinalsReader
is reading from.getReader
(LeafReaderContext context) Deprecated.Set current atomic reader.long
Deprecated.Return the memory usage of this object in bytes.
-
Field Details
-
source
Deprecated. -
ordsCache
Deprecated.
-
-
Constructor Details
-
CachedOrdinalsReader
Deprecated.Sole constructor.
-
-
Method Details
-
getCachedOrds
Deprecated.- Throws:
IOException
-
getIndexFieldName
Deprecated.Description copied from class:OrdinalsReader
Returns the indexed field name thisOrdinalsReader
is reading from.- Specified by:
getIndexFieldName
in classOrdinalsReader
-
getReader
Deprecated.Description copied from class:OrdinalsReader
Set current atomic reader.- Specified by:
getReader
in classOrdinalsReader
- Throws:
IOException
-
ramBytesUsed
public long ramBytesUsed()Deprecated.Description copied from interface:Accountable
Return the memory usage of this object in bytes. Negative values are illegal.- Specified by:
ramBytesUsed
in interfaceAccountable
-
getChildResources
Deprecated.Description copied from interface:Accountable
Returns nested resources of this class. The result should be a point-in-time snapshot (to avoid race conditions).- Specified by:
getChildResources
in interfaceAccountable
- See Also:
-