Module org.apache.lucene.sandbox
Class TaxonomyFacetsCutter
java.lang.Object
org.apache.lucene.sandbox.facet.cutters.TaxonomyFacetsCutter
- All Implemented Interfaces:
FacetCutter
FacetCutter
for facets that use taxonomy side-car index.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ParallelTaxonomyArrays.IntArray
private final boolean
private final FacetsConfig
private final String
private ParallelTaxonomyArrays.IntArray
private final TaxonomyReader
-
Constructor Summary
ConstructorsConstructorDescriptionTaxonomyFacetsCutter
(String indexFieldName, FacetsConfig facetsConfig, TaxonomyReader taxoReader) CreateFacetCutter
for taxonomy facets.TaxonomyFacetsCutter
(String indexFieldName, FacetsConfig facetsConfig, TaxonomyReader taxoReader, boolean disableRollup) Expert: CreateFacetCutter
for taxonomy facets. -
Method Summary
Modifier and TypeMethodDescriptioncreateLeafCutter
(LeafReaderContext context) Get cutter for the leaf.(package private) ParallelTaxonomyArrays.IntArray
Returns int[] mapping each ordinal to its first child; this is a large array and is computed (and then saved) the first time this method is invoked.getChildrenOrds
(int parentOrd) For facets that have hierarchy (levels), get all children ordinals for given ord.For facets that have hierarchy (levels), return all top level dimension ordinals that require rollup.(package private) ParallelTaxonomyArrays.IntArray
Returns int[] mapping each ordinal to its next sibling; this is a large array and is computed (and then saved) the first time this method is invoked.
-
Field Details
-
facetsConfig
-
taxoReader
-
indexFieldName
-
disableRollup
private final boolean disableRollup -
children
-
siblings
-
-
Constructor Details
-
TaxonomyFacetsCutter
public TaxonomyFacetsCutter(String indexFieldName, FacetsConfig facetsConfig, TaxonomyReader taxoReader) CreateFacetCutter
for taxonomy facets. -
TaxonomyFacetsCutter
public TaxonomyFacetsCutter(String indexFieldName, FacetsConfig facetsConfig, TaxonomyReader taxoReader, boolean disableRollup) Expert: CreateFacetCutter
for taxonomy facets.- Parameters:
disableRollup
- if set to true, rollup is disabled. In most cases users should not use it. Setting it to true silently leads to incorrect results for dimensions that require rollup. At the same time, if you are sure that there are no dimensions that require rollup, setting it to true might improve performance.
-
-
Method Details
-
getChildren
Returns int[] mapping each ordinal to its first child; this is a large array and is computed (and then saved) the first time this method is invoked.- Throws:
IOException
-
getSiblings
Returns int[] mapping each ordinal to its next sibling; this is a large array and is computed (and then saved) the first time this method is invoked.- Throws:
IOException
-
createLeafCutter
Description copied from interface:FacetCutter
Get cutter for the leaf.- Specified by:
createLeafCutter
in interfaceFacetCutter
- Throws:
IOException
-
getOrdinalsToRollup
Description copied from interface:FacetCutter
For facets that have hierarchy (levels), return all top level dimension ordinals that require rollup.Rollup is an optimization for facets types that support hierarchy, if single document belongs to at most one node in the hierarchy, we can first record data for these nodes only, and then roll up values to parent ordinals.
Default implementation returns null, which means that rollup is not needed.
- Specified by:
getOrdinalsToRollup
in interfaceFacetCutter
- Throws:
IOException
-
getChildrenOrds
Description copied from interface:FacetCutter
For facets that have hierarchy (levels), get all children ordinals for given ord.- Specified by:
getChildrenOrds
in interfaceFacetCutter
- Throws:
IOException
-