Class AssociationFloatSumFacetRequest
- java.lang.Object
-
- org.apache.lucene.facet.search.params.FacetRequest
-
- org.apache.lucene.facet.search.params.association.AssociationFloatSumFacetRequest
-
- All Implemented Interfaces:
Cloneable
public class AssociationFloatSumFacetRequest extends FacetRequest
Facet request for weighting facets according to their float association by summing the association values.- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.lucene.facet.search.params.FacetRequest
FacetRequest.ResultMode, FacetRequest.SortBy, FacetRequest.SortOrder
-
-
Field Summary
-
Fields inherited from class org.apache.lucene.facet.search.params.FacetRequest
DEFAULT_DEPTH, DEFAULT_RESULT_MODE, DEFAULT_SORT_BY
-
-
Constructor Summary
Constructors Constructor Description AssociationFloatSumFacetRequest(CategoryPath path, int num)Create a float association facet request for a given node in the taxonomy.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AggregatorcreateAggregator(boolean useComplements, FacetArrays arrays, org.apache.lucene.index.IndexReader reader, TaxonomyReader taxonomy)Create an aggregator for this facet request.doublegetValueOf(FacetArrays arrays, int ordinal)Return the value of a category used for facets computations for this request.booleanrequireDocumentScore()Indicates whether the results of this request depends on each result document's scorebooleansupportsComplements()Indicates whether this facet request is eligible for applying the complements optimization.-
Methods inherited from class org.apache.lucene.facet.search.params.FacetRequest
clone, createCategoryListIterator, createFacetResultsHandler, equals, getCategoryPath, getDepth, getNumLabel, getNumResults, getResultMode, getSortBy, getSortOrder, hashCode, setDepth, setNumLabel, setResultMode, setSortBy, setSortOrder, toString
-
-
-
-
Constructor Detail
-
AssociationFloatSumFacetRequest
public AssociationFloatSumFacetRequest(CategoryPath path, int num)
Create a float association facet request for a given node in the taxonomy.
-
-
Method Detail
-
createAggregator
public Aggregator createAggregator(boolean useComplements, FacetArrays arrays, org.apache.lucene.index.IndexReader reader, TaxonomyReader taxonomy) throws IOException
Description copied from class:FacetRequestCreate an aggregator for this facet request. Aggregator action depends on request definition. For a count request, it will usually increment the count for that facet.- Specified by:
createAggregatorin classFacetRequest- Parameters:
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.- Throws:
IOException
-
getValueOf
public double getValueOf(FacetArrays arrays, int ordinal)
Description copied from class:FacetRequestReturn the value of a category used for facets computations for this request. For a count request this would be the count for that facet, i.e. an integer number. but for other requests this can be the result of a more complex operation, and the result can be any double precision number. Having this method with a general name value which is double precision allows to have more compact API and code for handling counts and perhaps other requests (such as for associations) very similarly, and by the same code and API, avoiding code duplication.- Specified by:
getValueOfin classFacetRequest- Parameters:
arrays- provider for facet arrays in use for current computation.ordinal- an index into the count arrays now in effect inarrays. E.g., for ordinal number n, with partition, of size partitionSize, now covering n,getValueOfwould be invoked withidxbeing n % partitionSize.
-
supportsComplements
public boolean supportsComplements()
Description copied from class:FacetRequestIndicates whether this facet request is eligible for applying the complements optimization.- Overrides:
supportsComplementsin classFacetRequest
-
requireDocumentScore
public boolean requireDocumentScore()
Description copied from class:FacetRequestIndicates whether the results of this request depends on each result document's score- Specified by:
requireDocumentScorein classFacetRequest
-
-