|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.lucene.search.Filter
org.apache.lucene.search.RangeFilter
public class RangeFilter
A Filter that restricts search results to a range of values in a given field.
This code borrows heavily from RangeQuery
, but is implemented as a Filter
Constructor Summary | |
---|---|
RangeFilter(java.lang.String fieldName,
java.lang.String lowerTerm,
java.lang.String upperTerm,
boolean includeLower,
boolean includeUpper)
|
|
RangeFilter(java.lang.String fieldName,
java.lang.String lowerTerm,
java.lang.String upperTerm,
boolean includeLower,
boolean includeUpper,
java.text.Collator collator)
WARNING: Using this constructor and supplying a non-null value in the collator parameter will cause every single
index Term in the Field referenced by lowerTerm and/or upperTerm to be
examined. |
Method Summary | |
---|---|
java.util.BitSet |
bits(IndexReader reader)
Deprecated. Use getDocIdSet(IndexReader) instead. |
boolean |
equals(java.lang.Object o)
Returns true if o is equal to this. |
DocIdSet |
getDocIdSet(IndexReader reader)
Returns a DocIdSet with documents that should be permitted in search results. |
int |
hashCode()
Returns a hash code value for this object. |
static RangeFilter |
Less(java.lang.String fieldName,
java.lang.String upperTerm)
Constructs a filter for field fieldName matching
less than or equal to upperTerm . |
static RangeFilter |
More(java.lang.String fieldName,
java.lang.String lowerTerm)
Constructs a filter for field fieldName matching
greater than or equal to lowerTerm . |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RangeFilter(java.lang.String fieldName, java.lang.String lowerTerm, java.lang.String upperTerm, boolean includeLower, boolean includeUpper)
fieldName
- The field this range applies tolowerTerm
- The lower bound on this rangeupperTerm
- The upper bound on this rangeincludeLower
- Does this range include the lower bound?includeUpper
- Does this range include the upper bound?
java.lang.IllegalArgumentException
- if both terms are null or if
lowerTerm is null and includeLower is true (similar for upperTerm
and includeUpper)public RangeFilter(java.lang.String fieldName, java.lang.String lowerTerm, java.lang.String upperTerm, boolean includeLower, boolean includeUpper, java.text.Collator collator)
collator
parameter will cause every single
index Term in the Field referenced by lowerTerm and/or upperTerm to be
examined. Depending on the number of index Terms in this Field, the
operation could be very slow.
lowerTerm
- The lower bound on this rangeupperTerm
- The upper bound on this rangeincludeLower
- Does this range include the lower bound?includeUpper
- Does this range include the upper bound?collator
- The collator to use when determining range inclusion; set
to null to use Unicode code point ordering instead of collation.
java.lang.IllegalArgumentException
- if both terms are null or if
lowerTerm is null and includeLower is true (similar for upperTerm
and includeUpper)Method Detail |
---|
public static RangeFilter Less(java.lang.String fieldName, java.lang.String upperTerm)
fieldName
matching
less than or equal to upperTerm
.
public static RangeFilter More(java.lang.String fieldName, java.lang.String lowerTerm)
fieldName
matching
greater than or equal to lowerTerm
.
public java.util.BitSet bits(IndexReader reader) throws java.io.IOException
getDocIdSet(IndexReader)
instead.
bits
in class Filter
java.io.IOException
public DocIdSet getDocIdSet(IndexReader reader) throws java.io.IOException
getDocIdSet
in class Filter
java.io.IOException
DocIdBitSet
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
o
is equal to this.
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |