org.apache.lucene.facet.range
Class LongRange

java.lang.Object
  extended by org.apache.lucene.facet.range.Range
      extended by org.apache.lucene.facet.range.LongRange

public final class LongRange
extends Range

Represents a range over long values.

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

Field Summary
 long max
          Maximum.
 boolean maxInclusive
          True if the maximum value is inclusive.
 long min
          Minimum.
 boolean minInclusive
          True if the minimum value is inclusive.
 
Fields inherited from class org.apache.lucene.facet.range.Range
label
 
Constructor Summary
LongRange(String label, long minIn, boolean minInclusive, long maxIn, boolean maxInclusive)
          Create a LongRange.
 
Method Summary
 boolean accept(long value)
          True if this range accepts the provided value.
 Filter getFilter(Filter fastMatchFilter, ValueSource valueSource)
          Returns a new Filter accepting only documents in this range.
 String toString()
           
 
Methods inherited from class org.apache.lucene.facet.range.Range
failNoMatch, getFilter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

min

public final long min
Minimum.


max

public final long max
Maximum.


minInclusive

public final boolean minInclusive
True if the minimum value is inclusive.


maxInclusive

public final boolean maxInclusive
True if the maximum value is inclusive.

Constructor Detail

LongRange

public LongRange(String label,
                 long minIn,
                 boolean minInclusive,
                 long maxIn,
                 boolean maxInclusive)
Create a LongRange.

Method Detail

accept

public boolean accept(long value)
True if this range accepts the provided value.


toString

public String toString()
Overrides:
toString in class Object

getFilter

public Filter getFilter(Filter fastMatchFilter,
                        ValueSource valueSource)
Description copied from class: Range
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.

Specified by:
getFilter in class Range


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