public class LongValueFacetCounts extends Facets
Facets
implementation that computes counts for
all unique long values, more efficiently counting small values (0-1023) using an int array,
and switching to a HashMap
for values above 1023.
Retrieve all facet counts, in value order, with getAllChildrenSortByValue()
,
or get the topN values sorted by count with getTopChildrenSortByCount(int)
.Constructor and Description |
---|
LongValueFacetCounts(String field,
FacetsCollector hits,
boolean multiValued)
Create
LongValueFacetCounts , using either single-valued NumericDocValues or multi-valued SortedNumericDocValues from the
specified field. |
LongValueFacetCounts(String field,
IndexReader reader,
boolean multiValued)
Counts all facet values for this reader.
|
LongValueFacetCounts(String field,
LongValuesSource valueSource,
FacetsCollector hits)
Create
LongValueFacetCounts , using the provided
LongValuesSource . |
LongValueFacetCounts(String field,
LongValuesSource valueSource,
FacetsCollector hits,
boolean multiValued)
Create
LongValueFacetCounts , using the provided
LongValuesSource . |
LongValueFacetCounts(String field,
LongValuesSource valueSource,
IndexReader reader)
Counts all facet values for the provided
LongValuesSource . |
Modifier and Type | Method and Description |
---|---|
FacetResult |
getAllChildrenSortByValue()
Returns all unique values seen, sorted by value.
|
List<FacetResult> |
getAllDims(int topN)
Returns topN labels for any dimension that had hits,
sorted by the number of hits that dimension matched;
this is used for "sparse" faceting, where many
different dimensions were indexed, for example
depending on the type of document.
|
Number |
getSpecificValue(String dim,
String... path)
Return the count or value
for a specific path.
|
FacetResult |
getTopChildren(int topN,
String dim,
String... path)
Returns the topN child labels under the specified
path.
|
FacetResult |
getTopChildrenSortByCount(int topN)
Returns the specified top number of facets, sorted by count.
|
String |
toString() |
public LongValueFacetCounts(String field, FacetsCollector hits, boolean multiValued) throws IOException
LongValueFacetCounts
, using either single-valued NumericDocValues
or multi-valued SortedNumericDocValues
from the
specified field.IOException
public LongValueFacetCounts(String field, LongValuesSource valueSource, FacetsCollector hits) throws IOException
LongValueFacetCounts
, using the provided
LongValuesSource
. If hits is
null then all facets are counted.IOException
public LongValueFacetCounts(String field, LongValuesSource valueSource, FacetsCollector hits, boolean multiValued) throws IOException
LongValueFacetCounts
, using the provided
LongValuesSource
.
random access (implement DocIdSet.bits()
).IOException
public LongValueFacetCounts(String field, IndexReader reader, boolean multiValued) throws IOException
MatchAllDocsQuery
, but is more efficient.IOException
public LongValueFacetCounts(String field, LongValuesSource valueSource, IndexReader reader) throws IOException
LongValuesSource
. This produces the same result as computing
facets on a MatchAllDocsQuery
, but is more efficient.IOException
public FacetResult getTopChildren(int topN, String dim, String... path)
Facets
getTopChildren
in class Facets
public FacetResult getTopChildrenSortByCount(int topN)
public FacetResult getAllChildrenSortByValue()
public Number getSpecificValue(String dim, String... path) throws IOException
Facets
getSpecificValue
in class Facets
IOException
public List<FacetResult> getAllDims(int topN) throws IOException
Facets
getAllDims
in class Facets
IOException
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.