Package org.apache.lucene.search
Class PrefixQuery
java.lang.Object
org.apache.lucene.search.Query
org.apache.lucene.search.MultiTermQuery
org.apache.lucene.search.PrefixQuery
- All Implemented Interfaces:
Cloneable
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.lucene.search.MultiTermQuery
MultiTermQuery.ConstantScoreAutoRewrite, MultiTermQuery.RewriteMethod, MultiTermQuery.TopTermsBoostOnlyBooleanQueryRewrite, MultiTermQuery.TopTermsScoringBooleanQueryRewrite -
Field Summary
Fields inherited from class org.apache.lucene.search.MultiTermQuery
CONSTANT_SCORE_AUTO_REWRITE_DEFAULT, CONSTANT_SCORE_BOOLEAN_QUERY_REWRITE, CONSTANT_SCORE_FILTER_REWRITE, SCORING_BOOLEAN_QUERY_REWRITE -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.apache.lucene.search.MultiTermQuery
getField, getRewriteMethod, rewrite, setRewriteMethodMethods inherited from class org.apache.lucene.search.Query
clone, createWeight, extractTerms, getBoost, setBoost, toString
-
Constructor Details
-
PrefixQuery
Constructs a query for terms starting withprefix.
-
-
Method Details
-
getPrefix
Returns the prefix of this query. -
toString
Prints a user-readable version of this query. -
hashCode
public int hashCode()- Overrides:
hashCodein classMultiTermQuery
-
equals
- Overrides:
equalsin classMultiTermQuery
-