org.apache.lucene.search
Class RangeQuery

java.lang.Object
  extended by org.apache.lucene.search.Query
      extended by org.apache.lucene.search.RangeQuery
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class RangeQuery
extends Query

A Query that matches documents within an exclusive range.

Version:
$Id: RangeQuery.java,v 1.12 2004/03/29 22:48:03 cutting Exp $
See Also:
Serialized Form

Constructor Summary
RangeQuery(Term lowerTerm, Term upperTerm, boolean inclusive)
          Constructs a query selecting all terms greater than lowerTerm but less than upperTerm.
 
Method Summary
 Query combine(Query[] queries)
          Expert: called when re-writing queries under MultiSearcher.
 java.lang.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
 boolean isInclusive()
          Returns true if the range query is inclusive
 Query rewrite(IndexReader reader)
          FIXME: Describe rewrite method here.
 java.lang.String toString(java.lang.String field)
          Prints a user-readable version of this query.
 
Methods inherited from class org.apache.lucene.search.Query
clone, createWeight, getBoost, getSimilarity, mergeBooleanQueries, setBoost, toString, weight
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RangeQuery

public RangeQuery(Term lowerTerm,
                  Term upperTerm,
                  boolean inclusive)
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.

Method Detail

rewrite

public Query rewrite(IndexReader reader)
              throws java.io.IOException
FIXME: Describe rewrite method here.

Overrides:
rewrite in class Query
Parameters:
reader - an IndexReader value
Returns:
a Query value
Throws:
java.io.IOException - if an error occurs

combine

public Query combine(Query[] queries)
Description copied from class: Query
Expert: called when re-writing queries under MultiSearcher.

Only implemented by derived queries, with no Query.createWeight(Searcher) implementatation.

Overrides:
combine in class Query

getField

public java.lang.String getField()
Returns the field name for this query


getLowerTerm

public Term getLowerTerm()
Returns the lower term of this range query


getUpperTerm

public Term getUpperTerm()
Returns the upper term of this range query


isInclusive

public boolean isInclusive()
Returns true if the range query is inclusive


toString

public java.lang.String toString(java.lang.String field)
Prints a user-readable version of this query.

Specified by:
toString in class Query


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