-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
Fail span_multi
queries that don't use top_terms_*
rewriting
#27432
Comments
Discussed in fixit Friday. We should limit the expansion to a sane value and improve the documentation around rewriting of multi term queries. |
Does it mean enforcing a top-terms rewrite or failing the query if there are more than X terms? |
I'd prefer enforcing a top-terms rewrite with an explicit option to limit the expansion:
Then we can fail the query if an explicit |
Sounds good to me. Should it be a 7.0 change then? |
We can also add |
👍 |
Closed by #30913 |
Thanks @jimczi , are we planning to patch this on 6.4 /6.5 ? - I can rebase against 6.4 if you prefer ( Thats what we plan to launch in prod ;-) ) |
@nirmalc it's merged in 6.x already so 6.4 it is. |
The span multi term query limits the number of expanded terms to search only if the inner multi term query uses
top_terms_N
rewrite. Otherwise it extracts all terms that match the inner multi term query and use them to build a giantspan_or
query without any limit.We should force the inner multi term query to use a
top_terms_N
rewrite in order to limit the memory. Currently a prefix query likea*
would extract all term that starts witha
since the default rewrite of theprefix
query isconstant_score
. This mode is optimized forprefix
query and should never be used on aspan_multi
which needs to access all positions for the extracted terms.The text was updated successfully, but these errors were encountered: