elastic / elasticsearch

Free and Open Source, Distributed, RESTful Search Engine
https://www.elastic.co/products/elasticsearch
Other
1.51k stars 24.89k forks source link

Emit deprecation warnings only for new index or template (#117529) #117650

Closed dnhatn closed 5 days ago

dnhatn commented 5 days ago

Currently, we emit a deprecation warning in the parser of the source field when source mode is used in mappings. However, this behavior causes warnings to be emitted for every mapping update. In tests with assertions enabled, warnings are also triggered for every change to index metadata. As a result, deprecation warnings are inadvertently emitted for index or update requests.

This change relocates the deprecation check to the mapper, limiting it to cases where a new index is created or a template is created/updated.

Relates to #117524