public class PrefixTreeFacetCounter extends Object
NOTE: If for a given document and a given field using
multiple values are indexed (i.e. multi-valued) and at least one of them is a non-point, then there is a possibility
of double-counting the document in the facet results. Since each shape is independently turned into grid cells at
a resolution chosen by the shape's size, it's possible they will be indexed at different resolutions. This means
the document could be present in BOTH the postings for a cell in both its prefix and leaf variants. To avoid this,
use a single valued field with a
ShapeCollection (or WKT equivalent). Or
calculate a suitable level/distErr to index both and call
with the same value for all shapes for a given document/field.
|Modifier and Type||Class and Description|
A callback/visitor of facet counts.
|Modifier and Type||Method and Description|
Computes facets using a callback/visitor style design, allowing flexibility for the caller to determine what to do with each underlying count.
Lower-level per-leaf segment method.
public static void compute(PrefixTreeStrategy strategy, IndexReaderContext context, Bits topAcceptDocs, org.locationtech.spatial4j.shape.Shape queryShape, int facetLevel, PrefixTreeFacetCounter.FacetVisitor facetVisitor) throws IOException
strategy- the prefix tree strategy (contains the field reference, grid, max levels)
context- the IndexReader's context
topAcceptDocs- a Bits to limit counted docs. If null, live docs are counted.
queryShape- the shape to limit the range of facet counts to
facetLevel- the maximum depth (detail) of faceted cells
facetVisitor- the visitor/callback to receive the counts
public static void compute(PrefixTreeStrategy strategy, LeafReaderContext context, Bits acceptDocs, org.locationtech.spatial4j.shape.Shape queryShape, int facetLevel, PrefixTreeFacetCounter.FacetVisitor facetVisitor) throws IOException
Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.