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, automatonIsBinary, compiled, term
CONSTANT_SCORE_BOOLEAN_REWRITE, CONSTANT_SCORE_REWRITE, field, rewriteMethod, SCORING_BOOLEAN_REWRITE
NULL_ACCOUNTABLE
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, getTermsEnum, isAutomatonBinary, ramBytesUsed, visit
getField, getRewriteMethod, getTermsEnum, rewrite, setRewriteMethod
classHash, createWeight, sameClassAs, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getChildResources
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()
Query
QueryCache
works properly.hashCode
in class AutomatonQuery
Query.equals(Object)
public boolean equals(Object obj)
Query
QueryCache
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 AutomatonQuery
Query.sameClassAs(Object)
,
Query.classHash()
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.