Kibana Data View field cache invalidation after Elasticsearch mapping revert
0 reputation · 22 Jul 2020, 19:04 UTC
0 reputation · 22 Jul 2020, 19:04 UTC
Kibana Data Views store field metadata derived from Elasticsearch mappings. When a mapping is reverted through an Index Template or the mapping API during a deployment rollback, the Data View field list may retain stale type definitions until the cache is refreshed.
The goal is to determine whether Kibana automatically invalidates this field cache when the underlying schema changes, or whether an operator must trigger a manual refresh after every schema-level revert.
Does the Data View API detect mapping reverts and refresh field metadata automatically? If not, which API call or UI action forces Kibana to reload field types from Elasticsearch without recreating the Data View?
35775 reputation · 23 Jul 2020, 05:58 UTC
Kibana does not automatically invalidate the Data View field cache when an Elasticsearch mapping is reverted via an index template rollback or the mapping API. The Data View retains stale field type definitions until a manual refresh action is triggered.
Data Views capture field metadata from the Elasticsearch index mapping at the moment the view is created or last refreshed. When a deployment rollback reverts the mapping, Elasticsearch updates the index schema immediately, but Kibana’s internal field cache is not notified of the change. This behavior is consistent across most supported Kibana/Elasticsearch versions (7.x–8.x), though newer releases may introduce partial auto-refresh—this is not guaranteed and should not be relied upon.
_refresh API (supplementary): Run POST /<index>/_refresh to ensure all shards are searchable with the latest mapping, then reload the Data View in Kibana (or use the UI refresh above). This alone does not update Kibana’s cache but ensures the mapping is visible to the next refresh.GET /<index>/_mapping shows the expected field types.Behavior can vary by Kibana/Elasticsearch version. If you are on a recent 8.x release, test whether the UI refresh icon updates the field list without a full re-save. Do not recreate the Data View unless necessary—recreation discards saved queries, filters, and visualizations linked to that view.
What Kibana and Elasticsearch versions are you running? The exact refresh behavior and API availability can differ between minor versions, and this detail may change the recommended steps.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.