Package org.apache.lucene.sandbox.facet.cutters

# Class TaxonomyFacetsCutter

java.lang.Object
org.apache.lucene.sandbox.facet.cutters.TaxonomyFacetsCutter

All Implemented Interfaces:
  `FacetCutter`

public final class TaxonomyFacetsCutter extends Object implements FacetCutter
`FacetCutter` for facets that use taxonomy side-car index.

WARNING: This API is experimental and might change in incompatible ways in the next release.

## Constructor Summary

Constructors
Constructor
Description
`TaxonomyFacetsCutter(String indexFieldName, FacetsConfig facetsConfig, TaxonomyReader taxoReader)`
Create `FacetCutter` for taxonomy facets.
`TaxonomyFacetsCutter(String indexFieldName, FacetsConfig facetsConfig, TaxonomyReader taxoReader, boolean disableRollup)`
Expert: Create `FacetCutter` for taxonomy facets.

## Method Summary

Modifier and Type
Method
Description
`LeafFacetCutter`
`createLeafCutter(LeafReaderContext context)`
Get cutter for the leaf.
`OrdinalIterator`
`getChildrenOrds(int parentOrd)`
For facets that have hierarchy (levels), get all children ordinals for given ord.
`OrdinalIterator`
`getOrdinalsToRollup()`
For facets that have hierarchy (levels), return all top level dimension ordinals that require rollup.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### TaxonomyFacetsCutter

public TaxonomyFacetsCutter(String indexFieldName, FacetsConfig facetsConfig, TaxonomyReader taxoReader)
Create `FacetCutter` for taxonomy facets.

### TaxonomyFacetsCutter

public TaxonomyFacetsCutter(String indexFieldName, FacetsConfig facetsConfig, TaxonomyReader taxoReader, boolean disableRollup)
Expert: Create `FacetCutter` 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

### createLeafCutter

public LeafFacetCutter createLeafCutter(LeafReaderContext context) throws IOException
Description copied from interface: `FacetCutter`
Get cutter for the leaf.

Specified by:
  `createLeafCutter` in interface `FacetCutter`
Throws:
  `IOException`

### getOrdinalsToRollup

public OrdinalIterator getOrdinalsToRollup() throws IOException
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 interface `FacetCutter`
Throws:
  `IOException`

### getChildrenOrds

public OrdinalIterator getChildrenOrds(int parentOrd) throws IOException
Description copied from interface: `FacetCutter`
For facets that have hierarchy (levels), get all children ordinals for given ord.

Specified by:
  `getChildrenOrds` in interface `FacetCutter`
Throws:
  `IOException`