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)
Override and implement query instance equivalence properly in a subclass.
|
Term |
getPrefix()
Returns the prefix of this query.
|
int |
hashCode()
Override and implement query hash code properly in a subclass.
|
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, setRewriteMethodclassHash, createWeight, sameClassAs, 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()
QueryQueryCache works properly.hashCode in class AutomatonQueryQuery.equals(Object)public boolean equals(Object obj)
QueryQueryCache works properly.
Typically a query will be equal to another only if it's an instance of
the same class and its document-filtering properties are identical that other
instance. Utility methods are provided for certain repetitive code.equals in class AutomatonQueryQuery.sameClassAs(Object),
Query.classHash()Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.