public class RegexpQuery extends AutomatonQuery
org.apache.lucene.util.automaton package.
AutomatonQuery for more details.
The supported syntax is documented in the RegExp class.
Note this might be different than other regular expression implementations.
For some alternatives with different syntax, look under the sandbox.
Note this query can be slow, as it needs to iterate over many terms. In order
to prevent extremely slow RegexpQueries, a Regexp term should not start with
the expression .*
RegExpMultiTermQuery.ConstantScoreAutoRewrite, MultiTermQuery.RewriteMethod, MultiTermQuery.TopTermsBoostOnlyBooleanQueryRewrite, MultiTermQuery.TopTermsScoringBooleanQueryRewriteautomaton, compiled, termCONSTANT_SCORE_AUTO_REWRITE_DEFAULT, CONSTANT_SCORE_BOOLEAN_QUERY_REWRITE, CONSTANT_SCORE_FILTER_REWRITE, field, rewriteMethod, SCORING_BOOLEAN_QUERY_REWRITE| Constructor and Description |
|---|
RegexpQuery(Term term)
Constructs a query for terms matching
term. |
RegexpQuery(Term term,
int flags)
Constructs a query for terms matching
term. |
RegexpQuery(Term term,
int flags,
AutomatonProvider provider)
Constructs a query for terms matching
term. |
| Modifier and Type | Method and Description |
|---|---|
String |
toString(String field)
Prints a user-readable version of this query.
|
equals, getAutomaton, getTermsEnum, hashCodegetField, getRewriteMethod, getTermsEnum, rewrite, setRewriteMethodclone, createWeight, extractTerms, getBoost, setBoost, toStringpublic RegexpQuery(Term term)
term.
By default, all regular expression features are enabled.
term - regular expression.public RegexpQuery(Term term, int flags)
term.term - regular expression.flags - optional RegExp features from RegExppublic RegexpQuery(Term term, int flags, AutomatonProvider provider)
term.term - regular expression.flags - optional RegExp features from RegExpprovider - custom AutomatonProvider for named automatapublic String toString(String field)
toString in class AutomatonQueryCopyright © 2000-2014 Apache Software Foundation. All Rights Reserved.