-
Notifications
You must be signed in to change notification settings - Fork 24.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for regex queries on new wildcard field #54725
Comments
Pinging @elastic/es-search (:Search/Search) |
Hmm I had something working in eclipse but the build process packages jars in a way that means I don't have the privileged access to Regexp internals :(
|
One workaround is to change Lucene's Regexp class. It already has a "toStringTree" method but I propose adding another similar method but which creates a BooleanQuery rather than a string representation. This query can be used as an approximation to limit the set of documents visited with an automaton - something like this:
|
Another option would be to add a more generic Regexp walker method, and refactor both the toStringTree() and toAutomaton() methods to use it. Something like:
|
This feature is largely about building good approximation queries on the ngram index to limit the number of documents that need verification using an automaton built from the regex.
Lucene's Regexp.toStringTree() method gives a good template for walking a parsed regex query's logic. Rather than building a string we can do something similar which builds an approximation BooleanQuery on the 3gram index. This logic will have to walk a line between:
The text was updated successfully, but these errors were encountered: