diff --git a/redash/query_runner/elasticsearch.py b/redash/query_runner/elasticsearch.py index 825cec0eb7..2e70e4672c 100644 --- a/redash/query_runner/elasticsearch.py +++ b/redash/query_runner/elasticsearch.py @@ -123,8 +123,8 @@ def _get_query_mappings(self, url): if error: return mappings, error - for index_name in mappings_data: - index_mappings = mappings_data[index_name] + for index_name in mappings: + index_mappings = mappings[index_name] for m in index_mappings.get("mappings", {}): for property_name in index_mappings["mappings"][m]["properties"]: property_data = index_mappings["mappings"][m]["properties"][property_name]