org.apache.lucene.search
Class PrefixQuery
- java.lang.Object
-
- org.apache.lucene.search.Query
-
- org.apache.lucene.search.PrefixQuery
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable
public class PrefixQuery extends Query
A Query that matches documents containing terms with a specified prefix. A PrefixQuery is built by QueryParser for input likeapp*.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description PrefixQuery(Term prefix)Constructs a query for terms starting withprefix.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanequals(java.lang.Object o)Returns true iffois equal to this.TermgetPrefix()Returns the prefix of this query.inthashCode()Returns a hash code value for this object.Queryrewrite(IndexReader reader)Expert: called to re-write queries into primitive queries.java.lang.StringtoString(java.lang.String field)Prints a user-readable version of this query.-
Methods inherited from class org.apache.lucene.search.Query
clone, combine, extractTerms, getBoost, getSimilarity, mergeBooleanQueries, setBoost, toString, weight
-
-
-
-
Constructor Detail
-
PrefixQuery
public PrefixQuery(Term prefix)
Constructs a query for terms starting withprefix.
-
-
Method Detail
-
getPrefix
public Term getPrefix()
Returns the prefix of this query.
-
rewrite
public Query rewrite(IndexReader reader) throws java.io.IOException
Description copied from class:QueryExpert: called to re-write queries into primitive queries. For example, a PrefixQuery will be rewritten into a BooleanQuery that consists of TermQuerys.
-
toString
public java.lang.String toString(java.lang.String field)
Prints a user-readable version of this query.
-
equals
public boolean equals(java.lang.Object o)
Returns true iffois equal to this.- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
Returns a hash code value for this object.- Overrides:
hashCodein classjava.lang.Object
-
-
DataMelt 3.0 © DataMelt by jWork.ORG