TaxonomyFacetLabels (Lucene 10.5.1 facet API)
Description: declaration: package: org.apache.lucene.facet.taxonomy, class: TaxonomyFacetLabels

Package org.apache.lucene.facet.taxonomy

# Class TaxonomyFacetLabels

java.lang.Object
org.apache.lucene.facet.taxonomy.TaxonomyFacetLabels

public class TaxonomyFacetLabels extends Object
Utility class to easily retrieve previously indexed facet labels, allowing you to skip also adding stored fields for these values, reducing your index size.

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

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `class`
  `TaxonomyFacetLabels.FacetLabelReader`
  Utility class to retrieve facet labels for multiple documents.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TaxonomyFacetLabels(TaxonomyReader taxoReader, String indexFieldName)`
  Sole constructor.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `TaxonomyFacetLabels.FacetLabelReader`
  `getFacetLabelReader(LeafReaderContext readerContext)`
  Create and return an instance of `TaxonomyFacetLabels.FacetLabelReader` to retrieve facet labels for multiple documents and (optionally) for a specific dimension.

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

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

- ## Constructor Details

  - ### TaxonomyFacetLabels

    public TaxonomyFacetLabels(TaxonomyReader taxoReader, String indexFieldName)
    Sole constructor. Do not close the provided `TaxonomyReader` while still using this instance!

- ## Method Details

  - ### getFacetLabelReader

    public TaxonomyFacetLabels.FacetLabelReader getFacetLabelReader(LeafReaderContext readerContext) throws IOException
    Create and return an instance of `TaxonomyFacetLabels.FacetLabelReader` to retrieve facet labels for multiple documents and (optionally) for a specific dimension. You must create this per-segment, and then step through all hits, in order, for that segment.

    NOTE: This class is not thread-safe, so you must use a new instance of this class for each thread.

    Parameters:
      `readerContext` - LeafReaderContext used to access the `BinaryDocValues` facet field
    Returns:
      an instance of `TaxonomyFacetLabels.FacetLabelReader`
    Throws:
      `IOException` - when a low-level IO issue occurs