public class WildcardQuery extends MultiTermQuery
*, which
matches any character sequence (including the empty one), and ?,
which matches any single character. Note this query can be slow, as it
needs to iterate over many terms. In order to prevent extremely slow WildcardQueries,
a Wildcard term should not start with one of the wildcards * or
?.
This query uses the MultiTermQuery.CONSTANT_SCORE_AUTO_REWRITE_DEFAULT
rewrite method.
WildcardTermEnum,
Serialized FormMultiTermQuery.ConstantScoreAutoRewrite, MultiTermQuery.RewriteMethod, MultiTermQuery.TopTermsBoostOnlyBooleanQueryRewrite, MultiTermQuery.TopTermsScoringBooleanQueryRewrite| Modifier and Type | Field and Description |
|---|---|
protected Term |
term |
CONSTANT_SCORE_AUTO_REWRITE_DEFAULT, CONSTANT_SCORE_BOOLEAN_QUERY_REWRITE, CONSTANT_SCORE_FILTER_REWRITE, rewriteMethod, SCORING_BOOLEAN_QUERY_REWRITE| Constructor and Description |
|---|
WildcardQuery(Term term) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
protected FilteredTermEnum |
getEnum(IndexReader reader)
Construct the enumeration to be used, expanding the pattern term.
|
Term |
getTerm()
Returns the pattern term.
|
int |
hashCode() |
String |
toString(String field)
Prints a user-readable version of this query.
|
clearTotalNumberOfTerms, getRewriteMethod, getTotalNumberOfTerms, incTotalNumberOfTerms, rewrite, setRewriteMethodclone, combine, createWeight, extractTerms, getBoost, getSimilarity, mergeBooleanQueries, setBoost, toString, weightprotected Term term
public WildcardQuery(Term term)
protected FilteredTermEnum getEnum(IndexReader reader) throws IOException
MultiTermQuerygetEnum in class MultiTermQueryIOExceptionpublic Term getTerm()
public int hashCode()
hashCode in class MultiTermQuerypublic boolean equals(Object obj)
equals in class MultiTermQuery