org.apache.lucene.facet.range
Class Range

java.lang.Object
  extended by org.apache.lucene.facet.range.Range
Direct Known Subclasses:
DoubleRange, LongRange

public abstract class Range
extends Object

Base class for a single labeled range.

WARNING: This API is experimental and might change in incompatible ways in the next release.

Field Summary
 String label
          Label that identifies this range.
 
Constructor Summary
protected Range(String label)
          Sole constructor.
 
Method Summary
protected  void failNoMatch()
          Invoke this for a useless range.
abstract  Filter getFilter(Filter fastMatchFilter, ValueSource valueSource)
          Returns a new Filter accepting only documents in this range.
 Filter getFilter(ValueSource valueSource)
          Returns a new Filter accepting only documents in this range.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

label

public final String label
Label that identifies this range.

Constructor Detail

Range

protected Range(String label)
Sole constructor.

Method Detail

getFilter

public abstract Filter getFilter(Filter fastMatchFilter,
                                 ValueSource valueSource)
Returns a new Filter accepting only documents in this range. This filter is not general-purpose; you should either use it with DrillSideways by adding it to DrillDownQuery.add(java.lang.String, java.lang.String...), or pass it to FilteredQuery using its FilteredQuery.QUERY_FIRST_FILTER_STRATEGY. If the ValueSource is static, e.g. an indexed numeric field, then it may be more efficient to use NumericRangeFilter. The provided fastMatchFilter, if non-null, will first be consulted, and only if that is set for each document will the range then be checked.


getFilter

public Filter getFilter(ValueSource valueSource)
Returns a new Filter accepting only documents in this range. This filter is not general-purpose; you should either use it with DrillSideways by adding it to DrillDownQuery.add(java.lang.String, java.lang.String...), or pass it to FilteredQuery using its FilteredQuery.QUERY_FIRST_FILTER_STRATEGY. If the ValueSource is static, e.g. an indexed numeric field, then it may be more efficient to use NumericRangeFilter.


failNoMatch

protected void failNoMatch()
Invoke this for a useless range.



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