Documentation of 'org.apache.lucene.search.RangeFilter' Java class
RangeFilter
org.apache.lucene.search

Class RangeFilter

  • All Implemented Interfaces:
    java.io.Serializable


    public class RangeFilter
    extends Filter
    A Filter that restricts search results to a range of values in a given field.

    This code borrows heavily from RangeQuery, but is implemented as a Filter

    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      RangeFilter(java.lang.String fieldName, java.lang.String lowerTerm, java.lang.String upperTerm, boolean includeLower, boolean includeUpper) 
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.util.BitSet bits(IndexReader reader)
      Returns a BitSet with true for documents which should be permitted in search results, and false for those that should not.
      boolean equals(java.lang.Object o)
      Returns true if o is equal to this.
      int hashCode()
      Returns a hash code value for this object.
      static RangeFilter Less(java.lang.String fieldName, java.lang.String upperTerm)
      Constructs a filter for field fieldName matching less than or equal to upperTerm.
      static RangeFilter More(java.lang.String fieldName, java.lang.String lowerTerm)
      Constructs a filter for field fieldName matching greater than or equal to lowerTerm.
      java.lang.String toString() 
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • RangeFilter

        public RangeFilter(java.lang.String fieldName,
                           java.lang.String lowerTerm,
                           java.lang.String upperTerm,
                           boolean includeLower,
                           boolean includeUpper)
        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:
        java.lang.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(java.lang.String fieldName,
                                       java.lang.String upperTerm)
        Constructs a filter for field fieldName matching less than or equal to upperTerm.
      • More

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

        public java.util.BitSet bits(IndexReader reader)
                              throws java.io.IOException
        Returns a BitSet with true for documents which should be permitted in search results, and false for those that should not.
        Specified by:
        bits in class Filter
        Throws:
        java.io.IOException
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals(java.lang.Object o)
        Returns true if o is equal to this.
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Returns a hash code value for this object.
        Overrides:
        hashCode in class java.lang.Object

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.