refactored ESservice to use a more dynamic structure using Map<String, List<String>> to determine which mappings of which indices to include in a template. A template will be formed for each Map.Entry