public class PrefixQuery extends AutomatonQuery
app*.
This query uses the MultiTermQuery.CONSTANT_SCORE_REWRITE
rewrite method.
MultiTermQuery.RewriteMethod, MultiTermQuery.TopTermsBlendedFreqScoringRewrite, MultiTermQuery.TopTermsBoostOnlyBooleanQueryRewrite, MultiTermQuery.TopTermsScoringBooleanQueryRewriteautomaton, compiled, termCONSTANT_SCORE_BOOLEAN_REWRITE, CONSTANT_SCORE_REWRITE, field, rewriteMethod, SCORING_BOOLEAN_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.
|
int |
hashCode() |
static Automaton |
toAutomaton(BytesRef prefix)
Build an automaton accepting all terms with the specified prefix.
|
String |
toString(String field)
Prints a user-readable version of this query.
|
getAutomaton, getTermsEnumgetField, getRewriteMethod, getTermsEnum, rewrite, setRewriteMethodcreateWeight, toStringpublic PrefixQuery(Term prefix)
prefix.public static Automaton toAutomaton(BytesRef prefix)
public Term getPrefix()
public String toString(String field)
toString in class AutomatonQuerypublic int hashCode()
hashCode in class AutomatonQuerypublic boolean equals(Object obj)
equals in class AutomatonQueryCopyright © 2000-2016 Apache Software Foundation. All Rights Reserved.