Save This Page
Home » lucene-2.3.2-src » org.apache » lucene » search » [javadoc | source]
org.apache.lucene.search
public class: DateFilter [javadoc | source]
java.lang.Object
   org.apache.lucene.search.Filter
      org.apache.lucene.search.DateFilter

All Implemented Interfaces:
    Serializable

A Filter that restricts search results to a range of time.

For this to work, documents must have been indexed with a DateField .
Field Summary
 String field     
 String start     
 String end     
Constructor:
 public DateFilter(String f,
    Date from,
    Date to) 
    Constructs a filter for field f matching dates between from and to inclusively.
 public DateFilter(String f,
    long from,
    long to) 
    Constructs a filter for field f matching times between from and to inclusively.
Method from org.apache.lucene.search.DateFilter Summary:
After,   After,   Before,   Before,   bits,   toString
Methods from org.apache.lucene.search.Filter:
bits
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.lucene.search.DateFilter Detail:
 public static DateFilter After(String field,
    Date date) 
    Constructs a filter for field f matching dates on or after date.
 public static DateFilter After(String field,
    long time) 
    Constructs a filter for field f matching times on or after time.
 public static DateFilter Before(String field,
    Date date) 
    Constructs a filter for field f matching dates on or before before date.
 public static DateFilter Before(String field,
    long time) 
    Constructs a filter for field f matching times on or before time.
 public BitSet bits(IndexReader reader) throws IOException 
    Returns a BitSet with true for documents which should be permitted in search results, and false for those that should not.
 public String toString()