org.apache.lucene.facet.search
Class SumValueSourceFacetRequest

java.lang.Object
  extended by org.apache.lucene.facet.search.FacetRequest
      extended by org.apache.lucene.facet.search.SumValueSourceFacetRequest

public class SumValueSourceFacetRequest
extends FacetRequest

A FacetRequest which aggregates categories by the sum of the values, returned by a ValueSource, in the documents they are associated with. This allows aggregating the value of a category by e.g. summing the value of a NumericDocValuesField indexed for the document, or a more complex expression (from multiple fields) using the expressions module.

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.FacetRequest
FacetRequest.ResultMode, FacetRequest.SortOrder
 
Field Summary
 
Fields inherited from class org.apache.lucene.facet.search.FacetRequest
categoryPath, numResults
 
Constructor Summary
SumValueSourceFacetRequest(CategoryPath path, int num, ValueSource valueSource, boolean requiresDocScores)
          Constructor which takes the ValueSource from which to read the documents' values.
 
Method Summary
 FacetsAggregator createFacetsAggregator(FacetIndexingParams fip)
          Returns the FacetsAggregator which can aggregate the categories of this facet request.
 
Methods inherited from class org.apache.lucene.facet.search.FacetRequest
equals, getDepth, getNumLabel, getResultMode, getSortOrder, hashCode, setDepth, setNumLabel, setResultMode, setSortOrder, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SumValueSourceFacetRequest

public SumValueSourceFacetRequest(CategoryPath path,
                                  int num,
                                  ValueSource valueSource,
                                  boolean requiresDocScores)
Constructor which takes the ValueSource from which to read the documents' values. You can also specify if the value source requires document scores or not.

Method Detail

createFacetsAggregator

public FacetsAggregator createFacetsAggregator(FacetIndexingParams fip)
Description copied from class: FacetRequest
Returns the FacetsAggregator which can aggregate the categories of this facet request. The aggregator is expected to aggregate category values into FacetArrays. If the facet request does not support that, e.g. RangeFacetRequest, it can return null. Note though that such requests require a dedicated FacetsAccumulator.

Specified by:
createFacetsAggregator in class FacetRequest


Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.