|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.search.Query org.apache.lucene.search.MultiTermQuery org.apache.lucene.search.AutomatonQuery org.apache.lucene.search.WildcardQuery
public class WildcardQuery
Implements the wildcard search query. Supported wildcards are *
, which
matches any character sequence (including the empty one), and ?
,
which matches any single character. '\' is the escape 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 the wildcard *
This query uses the MultiTermQuery.CONSTANT_SCORE_AUTO_REWRITE_DEFAULT
rewrite method.
AutomatonQuery
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.lucene.search.MultiTermQuery |
---|
MultiTermQuery.ConstantScoreAutoRewrite, MultiTermQuery.RewriteMethod, MultiTermQuery.TopTermsBoostOnlyBooleanQueryRewrite, MultiTermQuery.TopTermsScoringBooleanQueryRewrite |
Field Summary | |
---|---|
static char |
WILDCARD_CHAR
Char equality with support for wildcards |
static char |
WILDCARD_ESCAPE
Escape character |
static char |
WILDCARD_STRING
String equality with support for wildcards |
Fields inherited from class org.apache.lucene.search.AutomatonQuery |
---|
automaton, compiled, term |
Fields inherited from class org.apache.lucene.search.MultiTermQuery |
---|
CONSTANT_SCORE_AUTO_REWRITE_DEFAULT, CONSTANT_SCORE_BOOLEAN_QUERY_REWRITE, CONSTANT_SCORE_FILTER_REWRITE, field, rewriteMethod, SCORING_BOOLEAN_QUERY_REWRITE |
Constructor Summary | |
---|---|
WildcardQuery(Term term)
Constructs a query for terms matching term . |
Method Summary | |
---|---|
Term |
getTerm()
Returns the pattern term. |
static Automaton |
toAutomaton(Term wildcardquery)
Convert Lucene wildcard syntax into an automaton. |
String |
toString(String field)
Prints a user-readable version of this query. |
Methods inherited from class org.apache.lucene.search.AutomatonQuery |
---|
equals, getTermsEnum, hashCode |
Methods inherited from class org.apache.lucene.search.MultiTermQuery |
---|
getField, getRewriteMethod, getTermsEnum, rewrite, setRewriteMethod |
Methods inherited from class org.apache.lucene.search.Query |
---|
clone, createWeight, extractTerms, getBoost, setBoost, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final char WILDCARD_STRING
public static final char WILDCARD_CHAR
public static final char WILDCARD_ESCAPE
Constructor Detail |
---|
public WildcardQuery(Term term)
term
.
Method Detail |
---|
public static Automaton toAutomaton(Term wildcardquery)
public Term getTerm()
public String toString(String field)
toString
in class AutomatonQuery
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |