public class PrefixQuery extends MultiTermQuery
app*.
This query uses the MultiTermQuery.CONSTANT_SCORE_AUTO_REWRITE_DEFAULT
rewrite method.
MultiTermQuery.ConstantScoreAutoRewrite, MultiTermQuery.RewriteMethod, MultiTermQuery.TopTermsBoostOnlyBooleanQueryRewrite, MultiTermQuery.TopTermsScoringBooleanQueryRewriteCONSTANT_SCORE_AUTO_REWRITE_DEFAULT, CONSTANT_SCORE_BOOLEAN_QUERY_REWRITE, CONSTANT_SCORE_FILTER_REWRITE, field, rewriteMethod, SCORING_BOOLEAN_QUERY_REWRITE| Constructor and Description |
|---|
PrefixQuery(Term prefix)
Constructs a query for terms starting with
prefix. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
Term |
getPrefix()
Returns the prefix of this query.
|
protected TermsEnum |
getTermsEnum(Terms terms,
AttributeSource atts)
Construct the enumeration to be used, expanding the
pattern term.
|
int |
hashCode() |
String |
toString(String field)
Prints a user-readable version of this query.
|
getField, getRewriteMethod, getTermsEnum, rewrite, setRewriteMethodclone, createWeight, extractTerms, getBoost, setBoost, toStringpublic PrefixQuery(Term prefix)
prefix.public Term getPrefix()
protected TermsEnum getTermsEnum(Terms terms, AttributeSource atts) throws IOException
MultiTermQueryTermsEnum.EMPTY if no
terms match). The TermsEnum must already be
positioned to the first matching term.
The given AttributeSource is passed by the MultiTermQuery.RewriteMethod to
provide attributes, the rewrite method uses to inform about e.g. maximum competitive boosts.
This is currently only used by TopTermsRewritegetTermsEnum in class MultiTermQueryIOExceptionpublic int hashCode()
hashCode in class MultiTermQuerypublic boolean equals(Object obj)
equals in class MultiTermQueryCopyright © 2000-2012 Apache Software Foundation. All Rights Reserved.