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 and Description
    --- | ---
    `class` | `TaxonomyFacetLabels.FacetLabelReader` Utility class to retrieve facet labels for multiple documents.

  - ### Constructor Summary

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

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and 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 Detail

    - #### TaxonomyFacetLabels

          public TaxonomyFacetLabels(TaxonomyReader taxoReader,
                                     String indexFieldName)
                              throws IOException

      Sole constructor. Do not close the provided `TaxonomyReader` while still using this instance!
      Throws:
        `IOException`

  - ### Method Detail

    - #### 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

Copyright © 2000-2024 Apache Software Foundation. All Rights Reserved.