org.cdlib.xtf.textEngine
Class NumericRangeQuery

Object
  extended by Query
      extended by NumericRangeQuery
All Implemented Interfaces:
Serializable, Cloneable

public class NumericRangeQuery
extends Query

A query that implements efficient range searching on numeric data. Handles positive numbers up to 63 bits.

See Also:
Serialized Form

Nested Class Summary
private  class NumericRangeQuery.NumericRangeScorer
           
private  class NumericRangeQuery.NumericRangeWeight
           
 
Field Summary
private  String fieldName
           
private  boolean includeLower
           
private  boolean includeUpper
           
private  String lowerVal
           
private  String upperVal
           
 
Constructor Summary
NumericRangeQuery(String fieldName, String lowerVal, String upperVal, boolean includeLower, boolean includeUpper)
           
 
Method Summary
protected  Weight createWeight(Searcher searcher)
           
 boolean equals(Object o)
          Returns true if o is equal to this.
 void extractTerms(Set terms)
           
 String getField()
          Returns the field name for this query
 String getLowerVal()
          Returns the value of the lower endpoint of this range query, null if open ended
 String getUpperVal()
          Returns the value of the upper endpoint of this range query, null if open ended
 int hashCode()
          Returns a hash code value for this object.
 boolean includesLower()
          Returns true if the lower endpoint is inclusive
 boolean includesUpper()
          Returns true if the upper endpoint is inclusive
 Query rewrite(IndexReader reader)
           
 String toString(String field)
          Prints a user-readable version of this query.
 
Methods inherited from class Query
clone, combine, getBoost, getSimilarity, mergeBooleanQueries, setBoost, toString, weight
 
Methods inherited from class Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

fieldName

private final String fieldName

includeLower

private final boolean includeLower

lowerVal

private final String lowerVal

includeUpper

private final boolean includeUpper

upperVal

private final String upperVal
Constructor Detail

NumericRangeQuery

public NumericRangeQuery(String fieldName,
                         String lowerVal,
                         String upperVal,
                         boolean includeLower,
                         boolean includeUpper)
Method Detail

getField

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


getLowerVal

public String getLowerVal()
Returns the value of the lower endpoint of this range query, null if open ended


getUpperVal

public String getUpperVal()
Returns the value of the upper endpoint of this range query, null if open ended


includesLower

public boolean includesLower()
Returns true if the lower endpoint is inclusive


includesUpper

public boolean includesUpper()
Returns true if the upper endpoint is inclusive


rewrite

public Query rewrite(IndexReader reader)
              throws IOException
Overrides:
rewrite in class Query
Throws:
IOException

extractTerms

public void extractTerms(Set terms)
Overrides:
extractTerms in class Query

createWeight

protected Weight createWeight(Searcher searcher)
Overrides:
createWeight in class Query

toString

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

Specified by:
toString in class Query

equals

public boolean equals(Object o)
Returns true if o is equal to this.

Overrides:
equals in class Object

hashCode

public int hashCode()
Returns a hash code value for this object.

Overrides:
hashCode in class Object