-
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
Exclude doc-values-only fields from '*' field expansion queries #82710
Comments
Pinging @elastic/es-search (Team:Search) |
I believe that this is not only a problem around expanding |
That is the case only when the lenient flag is set to true, while its default is false when the fields are set explicitly. On the other hand the lenient flag is set to true whenever |
A different way to think about this is that doc-value-only fields are fields where users are willing to trade some query performance for storage savings. In this context, you could argue that switching "index:false" on a field (e.g. in a template) should not lead to a different behavior on the query side, which is what this is proposing. While "index:false" was previously not an equivalent thing from a query perspective, with the introduction of doc-value-only fields, it has been so, and I would rather preserve query behavior (i.e. not break future users) rather than slightly extending the query semantics we used to have prior to doc-value-only fields. |
We have discussed this with the team and concluded that we are not going to exclude doc_value only fields from the existing expansion logic. We have embraced slower queries over time and it feels wrong that Also, doc_value only queries are currently rejected whenever |
#82602 and #82409 allow searching on fields with doc-values but no index. These fields would previously have been excluded from queries against all fields as they would throw an exception when queried, but instead they will now effectively do a full-table scan. We should add another check to
QueryParserHelper.resolveMappingFields()
to exclude these fields from all-field queries as well.The text was updated successfully, but these errors were encountered: