public class PrefixQuery extends MultiTermQuery
app*
.
This query uses the MultiTermQuery.CONSTANT_SCORE_FILTER_REWRITE
rewrite method.
MultiTermQuery.RewriteMethod, MultiTermQuery.TopTermsBoostOnlyBooleanQueryRewrite, MultiTermQuery.TopTermsScoringBooleanQueryRewrite
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, setRewriteMethod
clone, createWeight, extractTerms, getBoost, setBoost, toString
public PrefixQuery(Term prefix)
prefix
.public Term getPrefix()
protected TermsEnum getTermsEnum(Terms terms, AttributeSource atts) throws IOException
MultiTermQuery
TermsEnum.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 TopTermsRewrite
getTermsEnum
in class MultiTermQuery
IOException
public int hashCode()
hashCode
in class MultiTermQuery
public boolean equals(Object obj)
equals
in class MultiTermQuery
Copyright © 2000-2015 Apache Software Foundation. All Rights Reserved.