org.apache.lucene.facet.range
Class RangeFacetRequest<T extends Range>

java.lang.Object
  extended by org.apache.lucene.facet.search.FacetRequest
      extended by org.apache.lucene.facet.range.RangeFacetRequest<T>

public class RangeFacetRequest<T extends Range>
extends FacetRequest

A FacetRequest for dynamic ranges based on a NumericDocValues field or ValueSource. This does not use the taxonomy index nor any indexed facet 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.FacetRequest
FacetRequest.ResultMode, FacetRequest.SortOrder
 
Field Summary
 String label
           
 Range[] ranges
           
 
Fields inherited from class org.apache.lucene.facet.search.FacetRequest
categoryPath, numResults
 
Constructor Summary
RangeFacetRequest(String field, List<T> ranges)
          Create a request for the given ranges over the specified NumericDocValues field.
RangeFacetRequest(String field, T... ranges)
          Create a request for the given ranges over the specified NumericDocValues field.
RangeFacetRequest(String label, ValueSource valueSource, List<T> ranges)
          Create a request for the given ranges over the specified ValueSource.
RangeFacetRequest(String label, ValueSource valueSource, T... ranges)
          Create a request for the given ranges over the specified ValueSource.
 
Method Summary
 FacetsAggregator createFacetsAggregator(FacetIndexingParams fip)
          Returns the FacetsAggregator which can aggregate the categories of this facet request.
 FunctionValues getValues(AtomicReaderContext context)
          Returns the FunctionValues for the given AtomicReaderContext.
 
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
 

Field Detail

ranges

public final Range[] ranges

label

public final String label
Constructor Detail

RangeFacetRequest

public RangeFacetRequest(String field,
                         T... ranges)
Create a request for the given ranges over the specified NumericDocValues field. The field will be used to as the root's FacetResultNode label.


RangeFacetRequest

public RangeFacetRequest(String field,
                         List<T> ranges)
Create a request for the given ranges over the specified NumericDocValues field. The field will be used to as the root's FacetResultNode label.


RangeFacetRequest

public RangeFacetRequest(String label,
                         ValueSource valueSource,
                         T... ranges)
Create a request for the given ranges over the specified ValueSource. The label will be used to as the root's FacetResultNode label.


RangeFacetRequest

public RangeFacetRequest(String label,
                         ValueSource valueSource,
                         List<T> ranges)
Create a request for the given ranges over the specified ValueSource. The label will be used to as the root's FacetResultNode label.

Method Detail

getValues

public FunctionValues getValues(AtomicReaderContext context)
                         throws IOException
Returns the FunctionValues for the given AtomicReaderContext. If the request was created over a NumericDocValues field, the respective NumericDocValues is returned.

Throws:
IOException

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.