Package org.apache.lucene.facet.taxonomy
Class TaxonomyFacetLabels
java.lang.Object
org.apache.lucene.facet.taxonomy.TaxonomyFacetLabels
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 ClassesModifier and TypeClassDescriptionclassUtility class to retrieve facet labels for multiple documents. -
Constructor Summary
ConstructorsConstructorDescriptionTaxonomyFacetLabels(TaxonomyReader taxoReader, String indexFieldName) Sole constructor. -
Method Summary
Modifier and TypeMethodDescriptiongetFacetLabelReader(LeafReaderContext readerContext) Create and return an instance ofTaxonomyFacetLabels.FacetLabelReaderto retrieve facet labels for multiple documents and (optionally) for a specific dimension.
-
Constructor Details
-
TaxonomyFacetLabels
Sole constructor. Do not close the providedTaxonomyReaderwhile still using this instance!
-
-
Method Details
-
getFacetLabelReader
public TaxonomyFacetLabels.FacetLabelReader getFacetLabelReader(LeafReaderContext readerContext) throws IOException Create and return an instance ofTaxonomyFacetLabels.FacetLabelReaderto 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 theBinaryDocValuesfacet field- Returns:
- an instance of
TaxonomyFacetLabels.FacetLabelReader - Throws:
IOException- when a low-level IO issue occurs
-