From 2aa62cccf7f0950529fdec725d5cd0b7ca992b0e Mon Sep 17 00:00:00 2001 From: Dima Kovalchuk Date: Thu, 18 Aug 2022 15:41:02 +0300 Subject: [PATCH] Fetch settings for alias and save as alias name, not index --- elasticsearch_dsl/index.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/elasticsearch_dsl/index.py b/elasticsearch_dsl/index.py index 8e8dd369b..9cda0b40a 100644 --- a/elasticsearch_dsl/index.py +++ b/elasticsearch_dsl/index.py @@ -504,9 +504,12 @@ def get_settings(self, using=None, **kwargs): Any additional keyword arguments will be passed to ``Elasticsearch.indices.get_settings`` unchanged. """ - return self._get_connection(using).indices.get_settings( + settings = self._get_connection(using).indices.get_settings( index=self._name, **kwargs ) + if self._name not in settings: + settings[self._name] = list(settings.values())[0] + return settings def put_settings(self, using=None, **kwargs): """