Class SortedSetDocValuesReaderState
java.lang.Object
org.apache.lucene.facet.sortedset.SortedSetDocValuesReaderState
- All Implemented Interfaces:
Accountable
- Direct Known Subclasses:
DefaultSortedSetDocValuesReaderState
Wraps a
IndexReader and resolves ords using existing SortedSetDocValues APIs
without a separate taxonomy index. This makes faceting a bit slower, adds some cost at reopen
time, but avoids managing the separate taxonomy index. In addition, the tie-break during faceting
is now meaningful (in label sorted order).
NOTE: creating an instance of this class is somewhat costly, as it computes per-segment
ordinal maps, so you should create it once and re-use that one instance for a given IndexReader.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classHolds children and sibling information for a single dimension.static final recordHolds start/end range of ords, which maps to one dimension. -
Field Summary
FieldsFields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetDims()Returns a list of all dimensionsgetDimTree(String dim) Returns mapping from prefix toSortedSetDocValuesReaderState.DimTreeabstract SortedSetDocValuesReturn top-level doc values.abstract FacetsConfigReturns the associated facet config.abstract StringgetField()Indexed field we are reading.getOrdRange(String dim) Returns theSortedSetDocValuesReaderState.OrdRangefor this dimension.abstract Map<String, SortedSetDocValuesReaderState.OrdRange> Returns mapping from prefix toSortedSetDocValuesReaderState.OrdRange.abstract IndexReaderReturns top-level index reader.abstract intgetSize()Number of unique labels.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.lucene.util.Accountable
getChildResources, ramBytesUsed
-
Field Details
-
INVALID_ORDINAL
public static final int INVALID_ORDINALInvalid ordinal const- See Also:
-
-
Constructor Details
-
SortedSetDocValuesReaderState
protected SortedSetDocValuesReaderState()Sole constructor.
-
-
Method Details
-
getDocValues
Return top-level doc values.- Throws:
IOException
-
getField
Indexed field we are reading. -
getReader
Returns top-level index reader. -
getSize
public abstract int getSize()Number of unique labels. -
getFacetsConfig
Returns the associated facet config. -
getOrdRange
Returns theSortedSetDocValuesReaderState.OrdRangefor this dimension. -
getPrefixToOrdRange
Returns mapping from prefix toSortedSetDocValuesReaderState.OrdRange. -
getDimTree
Returns mapping from prefix toSortedSetDocValuesReaderState.DimTree -
getDims
Returns a list of all dimensions
-