RegexpQuery
A fast regular expression query based on the org.gnit.lucenekmp.util.automaton package.
Comparisons are fast
The term dictionary is enumerated in an intelligent way, to avoid comparisons. See [ ] 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 .*
See also
Constructors
Constructs a query for terms matching term.
Constructs a query for terms matching term.
Constructs a query for terms matching term.
Constructs a query for terms matching term.
Properties
Functions
Expert: Constructs an appropriate Weight implementation for this query.
Override and implement query instance equivalence properly in a subclass. This is required so that QueryCache works properly.
Constructs an enumeration that expands the pattern term. This method should only be called if the field exists (ie, implementations can assume the field does exist). This method never returns null. The returned TermsEnum is positioned to the first matching term.
Returns the automaton used to create this query
To rewrite to a simpler form, instead return a simpler enum from .getTermsEnum. For example, to rewrite to a single term, return a SingleTermsEnum
Recurse through the query tree, visiting any child queries.