Package org.apache.lucene.facet.taxonomy
Class TaxonomyFacetLabels.FacetLabelReader
java.lang.Object
org.apache.lucene.facet.taxonomy.TaxonomyFacetLabels.FacetLabelReader
- Enclosing class:
TaxonomyFacetLabels
Utility class to retrieve facet labels for multiple documents.
- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
Constructor Summary
ConstructorsConstructorDescriptionFacetLabelReader(SortedNumericDocValues ordinalValues) Construct from a specifiedSortedNumericDocValuesfield. -
Method Summary
Modifier and TypeMethodDescriptionnextFacetLabel(int docId) nextFacetLabel(int docId, String facetDimension) Retrieves the nextFacetLabelfor the specifieddocIdunder the requestedfacetDimension, ornullif there are no more.
-
Constructor Details
-
FacetLabelReader
Construct from a specifiedSortedNumericDocValuesfield.
-
-
Method Details
-
nextFacetLabel
Retrieves the nextFacetLabelfor the specifieddocId, ornullif there are no more. This method has state: if the provideddocIdis the same as the previous invocation, it returns the nextFacetLabelfor that document. Otherwise, it advances to the newdocIdand provides the firstFacetLabelfor that document, ornullif that document has no indexed facets. Each newdocIdmust be in strictly monotonic (increasing) order.NOTE: The returned FacetLabels may not be in the same order in which they were indexed
- Parameters:
docId- input docId provided in monotonic (non-decreasing) order- Returns:
- the first or next
FacetLabel, ornullif there are no more - Throws:
IOException- when a low-level IO issue occursIllegalArgumentException- if docId provided is less than docId supplied in an earlier invocation
-
nextFacetLabel
Retrieves the nextFacetLabelfor the specifieddocIdunder the requestedfacetDimension, ornullif there are no more. This method has state: if the provideddocIdis the same as the previous invocation, it returns the nextFacetLabelfor that document. Otherwise, it advances to the newdocIdand provides the firstFacetLabelfor that document, ornullif that document has no indexed facets. Each newdocIdmust be in strictly monotonic (increasing) order.NOTE: This method loads the
int[] parentsarray from the taxonomy index. The returned FacetLabels may not be in the same order in which they were indexed.- Parameters:
docId- input docId provided in non-decreasing order- Returns:
- the first or next
FacetLabel, ornullif there are no more - Throws:
IOException- ifTaxonomyReaderhas problems getting path for an ordinalIllegalArgumentException- if docId provided is less than docId supplied in an earlier invocationIllegalArgumentException- if facetDimension is null
-