Package org.apache.lucene.facet.taxonomy
Class CachedOrdinalsReader
- java.lang.Object
-
- org.apache.lucene.facet.taxonomy.OrdinalsReader
-
- org.apache.lucene.facet.taxonomy.CachedOrdinalsReader
-
- All Implemented Interfaces:
Accountable
@Deprecated public class CachedOrdinalsReader extends OrdinalsReader implements Accountable
Deprecated.Custom binary encodings for taxonomy ordinals are no longer supported starting with Lucene 9A per-segment cache of documents' facet ordinals. EveryCachedOrdinalsReader.CachedOrdsholds the ordinals in a rawint[], 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.CachedOrdsis 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
DocValuesFormatthat 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 Classes Modifier and Type Class Description static classCachedOrdinalsReader.CachedOrdsDeprecated.Holds the cached ordinals in two parallelint[]arrays.-
Nested classes/interfaces inherited from class org.apache.lucene.facet.taxonomy.OrdinalsReader
OrdinalsReader.OrdinalsSegmentReader
-
-
Field Summary
-
Fields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE
-
-
Constructor Summary
Constructors Constructor Description CachedOrdinalsReader(OrdinalsReader source)Deprecated.Sole constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Collection<Accountable>getChildResources()Deprecated.StringgetIndexFieldName()Deprecated.Returns the indexed field name thisOrdinalsReaderis reading from.OrdinalsReader.OrdinalsSegmentReadergetReader(LeafReaderContext context)Deprecated.Set current atomic reader.longramBytesUsed()Deprecated.
-
-
-
Constructor Detail
-
CachedOrdinalsReader
public CachedOrdinalsReader(OrdinalsReader source)
Deprecated.Sole constructor.
-
-
Method Detail
-
getIndexFieldName
public String getIndexFieldName()
Deprecated.Description copied from class:OrdinalsReaderReturns the indexed field name thisOrdinalsReaderis reading from.- Specified by:
getIndexFieldNamein classOrdinalsReader
-
getReader
public OrdinalsReader.OrdinalsSegmentReader getReader(LeafReaderContext context) throws IOException
Deprecated.Description copied from class:OrdinalsReaderSet current atomic reader.- Specified by:
getReaderin classOrdinalsReader- Throws:
IOException
-
ramBytesUsed
public long ramBytesUsed()
Deprecated.- Specified by:
ramBytesUsedin interfaceAccountable
-
getChildResources
public Collection<Accountable> getChildResources()
Deprecated.- Specified by:
getChildResourcesin interfaceAccountable
-
-