From 463edf9f9008bc8744ed2b25b0604a24543d0dd6 Mon Sep 17 00:00:00 2001 From: Josh Devins Date: Tue, 19 Nov 2019 14:08:57 +0100 Subject: [PATCH] Fixes field caps query params exceeding HTTP limit We want all fields from _field_caps so we just use the wildcard expression here. It's not clear why it didn't work before but it does now. This alleviates the need to pass all fields to _field_caps. See: https://github.com/elastic/eland/issues/52 --- eland/mappings.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/eland/mappings.py b/eland/mappings.py index 5a62bfb..e4ba145 100644 --- a/eland/mappings.py +++ b/eland/mappings.py @@ -52,10 +52,9 @@ class Mappings: if (client is not None) and (index_pattern is not None): get_mapping = client.get_mapping(index=index_pattern) - # Get all fields (including all nested) and then field_caps - # for these names (fields=* doesn't appear to work effectively...) + # Get all fields (including all nested) and then all field_caps all_fields = Mappings._extract_fields_from_mapping(get_mapping) - all_fields_caps = client.field_caps(index=index_pattern, fields=list(all_fields.keys())) + all_fields_caps = client.field_caps(index=index_pattern, fields='*') # Get top level (not sub-field multifield) mappings source_fields = Mappings._extract_fields_from_mapping(get_mapping, source_only=True)