org.apache.lucene.search
Class PrefixQuery
- Cloneable, Serializable
A Query that matches documents containing terms with a specified prefix. A PrefixQuery
is built by QueryParser for input like app*.
boolean | equals(Object o)- Returns true iff
o is equal to this.
|
Term | getPrefix()- Returns the prefix of this query.
|
int | hashCode()- Returns a hash code value for this object.
|
Query | rewrite(IndexReader reader)- Expert: called to re-write queries into primitive queries.
|
String | toString(String field)- Prints a user-readable version of this query.
|
clone, combine, createWeight, extractTerms, getBoost, getSimilarity, mergeBooleanQueries, rewrite, setBoost, toString, toString, weight |
PrefixQuery
public PrefixQuery(Term prefix)
Constructs a query for terms starting with prefix.
equals
public boolean equals(Object o)
Returns true iff o is equal to this.
getPrefix
public Term getPrefix()
Returns the prefix of this query.
hashCode
public int hashCode()
Returns a hash code value for this object.
rewrite
public Query rewrite(IndexReader reader)
throws IOExceptionExpert: called to re-write queries into primitive queries. For example,
a PrefixQuery will be rewritten into a BooleanQuery that consists
of TermQuerys.
- rewrite in interface Query
toString
public String toString(String field)
Prints a user-readable version of this query.
- toString in interface Query
Copyright © 2000-2007 Apache Software Foundation. All Rights Reserved.