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 only supports flat facets (dimension + label), and it
makes faceting a bit slower, adds some cost at reopen time, but avoids managing the separate
taxonomy index. It also requires less RAM than the taxonomy index, as it manages the flat
(2-level) hierarchy more efficiently. 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
Modifier and TypeClassDescriptionstatic final class
Holds children and sibling information for a single dimension.static final class
Holds start/end range of ords, which maps to one dimension. -
Field Summary
Fields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetDims()
Returns a list of all dimensionsgetDimTree
(String dim) Returns mapping from prefix toSortedSetDocValuesReaderState.DimTree
abstract SortedSetDocValues
Return top-level doc values.abstract FacetsConfig
Returns the associated facet config.abstract String
getField()
Indexed field we are reading.getOrdRange
(String dim) Returns theSortedSetDocValuesReaderState.OrdRange
for this dimension.abstract Map<String,
SortedSetDocValuesReaderState.OrdRange> Returns mapping from prefix toSortedSetDocValuesReaderState.OrdRange
.abstract IndexReader
Returns top-level index reader.abstract int
getSize()
Number of unique labels.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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.OrdRange
for this dimension. -
getPrefixToOrdRange
Returns mapping from prefix toSortedSetDocValuesReaderState.OrdRange
. -
getDimTree
Returns mapping from prefix toSortedSetDocValuesReaderState.DimTree
-
getDims
Returns a list of all dimensions
-