| java.lang.Object org.apache.lucene.search.Query org.apache.lucene.search.RangeQuery
RangeQuery | public class RangeQuery extends Query (Code) | | A Query that matches documents within an exclusive range. A RangeQuery
is built by QueryParser for input like [010 TO 120] but only if the QueryParser has
the useOldRangeQuery property set to true. The QueryParser default behaviour is to use
the newer ConstantScoreRangeQuery class. This is generally preferable because:
- It is faster than RangeQuery
- Unlike RangeQuery, it does not cause a BooleanQuery.TooManyClauses exception if the range of values is large
- Unlike RangeQuery it does not influence scoring based on the scarcity of individual terms that may match
See Also: ConstantScoreRangeQuery version: $Id: RangeQuery.java 520891 2007-03-21 13:58:47Z yonik $ |
Constructor Summary | |
public | RangeQuery(Term lowerTerm, Term upperTerm, boolean inclusive) Constructs a query selecting all terms greater than
lowerTerm but less than upperTerm . |
RangeQuery | public RangeQuery(Term lowerTerm, Term upperTerm, boolean inclusive)(Code) | | Constructs a query selecting all terms greater than
lowerTerm but less than upperTerm .
There must be at least one term and either term may be null,
in which case there is no bound on that side, but if there are
two terms, both terms must be for the same field.
|
equals | public boolean equals(Object o)(Code) | | Returns true iff o is equal to this.
|
getField | public String getField()(Code) | | Returns the field name for this query
|
getLowerTerm | public Term getLowerTerm()(Code) | | Returns the lower term of this range query
|
getUpperTerm | public Term getUpperTerm()(Code) | | Returns the upper term of this range query
|
hashCode | public int hashCode()(Code) | | Returns a hash code value for this object.
|
isInclusive | public boolean isInclusive()(Code) | | Returns true if the range query is inclusive
|
toString | public String toString(String field)(Code) | | Prints a user-readable version of this query.
|
|
|