[data.search.aggs] Remove use_field_mapping
from top hits agg
#71168
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #47727
Closes #64734
Closes #68883
Summary
In #22771 we added a
format
parameter to docvalues fields in top hits aggs so that we could explicitly overridedate
fields formats. For non-date fields we useduse_field_mapping
as a fallback, which ES introduced in6.x
to ease the transition to7.0
.In
7.0
, ES began formatting docvalues fields using the field's mapping definition by default, and added a deprecation warning foruse_field_mapping
as explained in #47727.As of
8.0
, theuse_field_mapping
option for docvalues fields has been removed altogether, which has been causing errors onmaster
.This PR removes
use_field_mapping
from the top hits agg docvalues fields, which should resolve #68883. It also re-enables a skipped functional test as explained in #64734.I'll also backport this so that the deprecation warning can be removed as of
7.9
.This should have no effect on saved visualizations as that parameter was added to the DSL on-the-fly when the query was generated, but was never stored in saved objects.