public class AutomatonQuery extends MultiTermQuery
Query that will match terms against a finite-state machine.
This query will match documents that contain terms accepted by a given
finite-state machine. The automaton can be constructed with the
org.apache.lucene.util.automaton API. Alternatively, it can be
created from a regular expression with RegexpQuery or from
the standard Lucene wildcard syntax with WildcardQuery.
When the query is executed, it will create an equivalent DFA of the
finite-state machine, and will enumerate the term dictionary in an
intelligent way to reduce the number of comparisons. For example: the regular
expression of [dl]og? will make approximately four comparisons:
do, dog, lo, and log.
MultiTermQuery.ConstantScoreAutoRewrite, MultiTermQuery.RewriteMethod, MultiTermQuery.TopTermsBoostOnlyBooleanQueryRewrite, MultiTermQuery.TopTermsScoringBooleanQueryRewriteCONSTANT_SCORE_AUTO_REWRITE_DEFAULT, CONSTANT_SCORE_BOOLEAN_QUERY_REWRITE, CONSTANT_SCORE_FILTER_REWRITE, SCORING_BOOLEAN_QUERY_REWRITE| Constructor and Description |
|---|
AutomatonQuery(Term term,
Automaton automaton)
Create a new AutomatonQuery from an
Automaton. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
Automaton |
getAutomaton()
Returns the automaton used to create this query
|
int |
hashCode() |
String |
toString(String field)
Prints a query to a string, with
field assumed to be the
default field and omitted. |
getField, getRewriteMethod, rewrite, setRewriteMethodclone, createWeight, extractTerms, getBoost, setBoost, toStringpublic int hashCode()
hashCode in class MultiTermQuerypublic boolean equals(Object obj)
equals in class MultiTermQuerypublic String toString(String field)
Queryfield assumed to be the
default field and omitted.public Automaton getAutomaton()
Copyright © 2010 - 2020 Adobe. All Rights Reserved