org.apache.lucene.search
Class RangeFilter

java.lang.Object
  extended by org.apache.lucene.search.Filter
      extended by org.apache.lucene.search.MultiTermQueryWrapperFilter
          extended by org.apache.lucene.search.RangeFilter
All Implemented Interfaces:
Serializable

Deprecated. Use TermRangeFilter for term ranges or NumericRangeFilter for numeric ranges instead. This class will be removed in Lucene 3.0.

public class RangeFilter
extends MultiTermQueryWrapperFilter

A Filter that restricts search results to a range of values in a given field.

This filter matches the documents looking for terms that fall into the supplied range according to String.compareTo(String). It is not intended for numerical ranges, use NumericRangeFilter instead.

If you construct a large number of range filters with different ranges but on the same field, FieldCacheRangeFilter may have significantly better performance.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.lucene.search.MultiTermQueryWrapperFilter
query
 
Constructor Summary
RangeFilter(String fieldName, String lowerTerm, String upperTerm, boolean includeLower, boolean includeUpper)
          Deprecated.  
RangeFilter(String fieldName, String lowerTerm, String upperTerm, boolean includeLower, boolean includeUpper, Collator collator)
          Deprecated. 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
static RangeFilter Less(String fieldName, String upperTerm)
          Deprecated. Constructs a filter for field fieldName matching less than or equal to upperTerm.
static RangeFilter More(String fieldName, String lowerTerm)
          Deprecated. Constructs a filter for field fieldName matching greater than or equal to lowerTerm.
 
Methods inherited from class org.apache.lucene.search.MultiTermQueryWrapperFilter
bits, clearTotalNumberOfTerms, equals, getDocIdSet, getTotalNumberOfTerms, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RangeFilter

public RangeFilter(String fieldName,
                   String lowerTerm,
                   String upperTerm,
                   boolean includeLower,
                   boolean includeUpper)
Deprecated. 
Parameters:
fieldName - The field this range applies to
lowerTerm - The lower bound on this range
upperTerm - The upper bound on this range
includeLower - Does this range include the lower bound?
includeUpper - Does this range include the upper bound?
Throws:
IllegalArgumentException - if both terms are null or if lowerTerm is null and includeLower is true (similar for upperTerm and includeUpper)

RangeFilter

public RangeFilter(String fieldName,
                   String lowerTerm,
                   String upperTerm,
                   boolean includeLower,
                   boolean includeUpper,
                   Collator collator)
Deprecated. 
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. Depending on the number of index Terms in this Field, the operation could be very slow.

Parameters:
lowerTerm - The lower bound on this range
upperTerm - The upper bound on this range
includeLower - 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.
Throws:
IllegalArgumentException - if both terms are null or if lowerTerm is null and includeLower is true (similar for upperTerm and includeUpper)
Method Detail

Less

public static RangeFilter Less(String fieldName,
                               String upperTerm)
Deprecated. 
Constructs a filter for field fieldName matching less than or equal to upperTerm.


More

public static RangeFilter More(String fieldName,
                               String lowerTerm)
Deprecated. 
Constructs a filter for field fieldName matching greater than or equal to lowerTerm.



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