|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.lucene.search.Query
org.apache.lucene.search.RangeQuery
public class RangeQuery
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:
ConstantScoreRangeQuery
,
Serialized FormConstructor Summary | |
---|---|
RangeQuery(Term lowerTerm,
Term upperTerm,
boolean inclusive)
Constructs a query selecting all terms greater than lowerTerm but less than upperTerm . |
Method Summary | |
---|---|
boolean |
equals(Object o)
Returns true iff o is equal to this. |
String |
getField()
Returns the field name for this query |
Term |
getLowerTerm()
Returns the lower term of this range query |
Term |
getUpperTerm()
Returns the upper term of this range query |
int |
hashCode()
Returns a hash code value for this object. |
boolean |
isInclusive()
Returns true if the range query is inclusive |
Query |
rewrite(IndexReader reader)
Expert: called to re-write queries into primitive queries. |
String |
toString(String field)
Prints a user-readable version of this query. |
Methods inherited from class org.apache.lucene.search.Query |
---|
clone, combine, createWeight, extractTerms, getBoost, getSimilarity, mergeBooleanQueries, setBoost, toString, weight |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RangeQuery(Term lowerTerm, Term upperTerm, boolean inclusive)
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.
Method Detail |
---|
public Query rewrite(IndexReader reader) throws IOException
Query
rewrite
in class Query
IOException
public String getField()
public Term getLowerTerm()
public Term getUpperTerm()
public boolean isInclusive()
true
if the range query is inclusive
public String toString(String field)
toString
in class Query
public boolean equals(Object o)
o
is equal to this.
equals
in class Object
public int hashCode()
hashCode
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |