public class CountFacetRequest extends FacetRequest
FacetRequest.ResultMode, FacetRequest.SortBy, FacetRequest.SortOrder
DEFAULT_DEPTH, DEFAULT_RESULT_MODE, DEFAULT_SORT_BY
Constructor and Description |
---|
CountFacetRequest(CategoryPath path,
int num)
Create a count facet request for a given node in the taxonomy.
|
Modifier and Type | Method and Description |
---|---|
Aggregator |
createAggregator(boolean useComplements,
FacetArrays arrays,
IndexReader reader,
TaxonomyReader taxonomy)
Create an aggregator for this facet request.
|
double |
getValueOf(FacetArrays arrays,
int ordinal)
Return the value of a category used for facets computations for this
request.
|
boolean |
requireDocumentScore()
Indicates whether the results of this request depends on each result document's score
|
boolean |
supportsComplements()
Indicates whether this facet request is eligible for applying the complements optimization.
|
clone, createCategoryListIterator, createFacetResultsHandler, equals, getCategoryPath, getDepth, getNumLabel, getNumResults, getResultMode, getSortBy, getSortOrder, hashCode, setDepth, setNumLabel, setResultMode, setSortBy, setSortOrder, toString
public CountFacetRequest(CategoryPath path, int num)
path
- category path of the category of interest.num
- number of child categories for which count info is requeted.
reqiested. Default implementation will find top categories, -
this behavior can be overridden by overriding
FacetRequest.createFacetResultsHandler(TaxonomyReader)
.public Aggregator createAggregator(boolean useComplements, FacetArrays arrays, IndexReader reader, TaxonomyReader taxonomy)
FacetRequest
createAggregator
in class FacetRequest
useComplements
- whether the complements optimization is being used for current
computation.arrays
- provider for facet arrays in use for current computation.reader
- index reader in effect.taxonomy
- reader of taxonomy in effect.public double getValueOf(FacetArrays arrays, int ordinal)
FacetRequest
getValueOf
in class FacetRequest
arrays
- provider for facet arrays in use for current computation.ordinal
- an index into the count arrays now in effect in
arrays
. E.g., for ordinal number n, with
partition, of size partitionSize, now covering n,
getValueOf
would be invoked with idx
being n % partitionSize.public boolean supportsComplements()
FacetRequest
supportsComplements
in class FacetRequest
public boolean requireDocumentScore()
FacetRequest
requireDocumentScore
in class FacetRequest