-
Notifications
You must be signed in to change notification settings - Fork 25k
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 a soft limit for trailing wildcard character length? #38861
Comments
Pinging @elastic/es-search |
We discussed this internally and we think it's a good way to promote the usage of the |
Hello, I would like to work on this issue. Could I get some pointers as to which classes are involved in this? |
@lmiskiew you can check |
@jimczi Thank you. |
@jimczi Hello, I'm having trouble trying to get the number of expanded terms. I tried to use the |
Thanks @lmiskiew , counting the number of expansions is tricky. The prefix query has multiple rewrite methods that depend on the options provided by the user and they all expand terms differently. We could wrap the rewrite method or the query to count the terms lazily (when the query is executed) but considering the complexity I wonder if this is something we should pursue. Since we already have options to avoid prefix queries entirely (
We have protection in place to limit the expansion for some rewrite methods ( |
This has been open for quite a while, and hasn't had a lot of interest. For now I'm going to close this as something we aren't planning on implementing. We can re-open it later if needed. |
We currently provide a configurable
allow_leading_wildcard
option as a way to safeguard against leading wildcards. Trailing wildcards can also be painful as observed many times in the past, esp. when users issue queries likea*
,1*
, etc..While we can ask users to add protection themselves to their apps to require at least N characters before wildcard queries are accepted, it can be helpful to provide a configurable soft limit option in Elasticsearch (where trailing wildcards will not be allowed until there is N characters provided). Not sure what's a good default is for this. 2 or 3 characters perhaps?
The text was updated successfully, but these errors were encountered: