Home » lucene-3.0.1-src » org.apache » lucene » search » [javadoc | source]
org.apache.lucene.search
public class: PrefixQuery [javadoc | source]
java.lang.Object
   org.apache.lucene.search.Query
      org.apache.lucene.search.MultiTermQuery
         org.apache.lucene.search.PrefixQuery

All Implemented Interfaces:
    Cloneable, Serializable

A Query that matches documents containing terms with a specified prefix. A PrefixQuery is built by QueryParser for input like app*.

This query uses the MultiTermQuery#CONSTANT_SCORE_AUTO_REWRITE_DEFAULT rewrite method.
Fields inherited from org.apache.lucene.search.MultiTermQuery:
rewriteMethod,  numberOfTerms,  CONSTANT_SCORE_FILTER_REWRITE,  SCORING_BOOLEAN_QUERY_REWRITE,  CONSTANT_SCORE_BOOLEAN_QUERY_REWRITE,  CONSTANT_SCORE_AUTO_REWRITE_DEFAULT
Constructor:
 public PrefixQuery(Term prefix) 
    Constructs a query for terms starting with prefix.
Method from org.apache.lucene.search.PrefixQuery Summary:
equals,   getEnum,   getPrefix,   hashCode,   toString
Methods from org.apache.lucene.search.MultiTermQuery:
clearTotalNumberOfTerms,   equals,   getEnum,   getRewriteMethod,   getTotalNumberOfTerms,   hashCode,   incTotalNumberOfTerms,   rewrite,   setRewriteMethod
Methods from org.apache.lucene.search.Query:
clone,   combine,   createWeight,   equals,   extractTerms,   getBoost,   getSimilarity,   hashCode,   mergeBooleanQueries,   rewrite,   setBoost,   toString,   toString,   weight
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.lucene.search.PrefixQuery Detail:
 public boolean equals(Object obj) 
 protected FilteredTermEnum getEnum(IndexReader reader) throws IOException 
 public Term getPrefix() 
    Returns the prefix of this query.
 public int hashCode() 
 public String toString(String field) 
    Prints a user-readable version of this query.