public class PrefixQuery extends AutomatonQuery
app*
.
This query uses the MultiTermQuery.CONSTANT_SCORE_REWRITE
rewrite method.
MultiTermQuery.RewriteMethod, MultiTermQuery.TopTermsBlendedFreqScoringRewrite, MultiTermQuery.TopTermsBoostOnlyBooleanQueryRewrite, MultiTermQuery.TopTermsScoringBooleanQueryRewrite
automaton, compiled, term
CONSTANT_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, getTermsEnum
getField, getRewriteMethod, getTermsEnum, rewrite, setRewriteMethod
createWeight, toString
public PrefixQuery(Term prefix)
prefix
.public static Automaton toAutomaton(BytesRef prefix)
public Term getPrefix()
public String toString(String field)
toString
in class AutomatonQuery
public int hashCode()
hashCode
in class AutomatonQuery
public boolean equals(Object obj)
equals
in class AutomatonQuery
Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.