org.apache.lucene.search
public class RangeFilter extends Filter
This code borrows heavily from RangeQuery, but is implemented as a Filter (much like DateFilter).
Constructor Summary | |
---|---|
RangeFilter(String fieldName, String lowerTerm, String upperTerm, boolean includeLower, boolean includeUpper) |
Method Summary | |
---|---|
BitSet | bits(IndexReader reader)
Returns a BitSet with true for documents which should be
permitted in search results, and false for those that should
not. |
boolean | equals(Object o) Returns true if o is equal to this. |
int | hashCode() Returns a hash code value for this object. |
static RangeFilter | Less(String fieldName, String upperTerm)
Constructs a filter for field fieldName matching
less than or equal to upperTerm . |
static RangeFilter | More(String fieldName, String lowerTerm)
Constructs a filter for field fieldName matching
greater than or equal to lowerTerm . |
String | toString() |
Parameters: fieldName The field this range applies to lowerTerm The lower bound on this range upperTerm The upper bound on this range includeLower Does this range include the lower bound? includeUpper Does this range include the upper bound?
Throws: IllegalArgumentException if both terms are null or if lowerTerm is null and includeLower is true (similar for upperTerm and includeUpper)
o
is equal to this.fieldName
matching
less than or equal to upperTerm
.fieldName
matching
greater than or equal to lowerTerm
.