docs: @SuppressWarnings("unchecked")
      private String getEsType(ESMapping mapping, String fieldName) {
          String key = mapping.get_index() + "-" + mapping.get_type();
          Map<String, String> fieldType = esFieldTypes.get(key);
          if (fieldType == null) {
              ImmutableOpenMap<String, MappingMetaData> mappings;
              try {
                  mappings = transportClient.admin()
                      .cluster()
                      .prepareState()
                      .execute()
                      .actionGet()
                      .getState()
                      .getMetaData()
                      .getIndices()
                      .get(mapping.get_index())
                      .getMappings();
              } catch (NullPointerException e) {
                  throw new IllegalArgumentException("Not found the mapping info of index: " + mapping.get_index());
              }
              MappingMetaData mappingMetaData = mappings.get(mapping.get_type());
              if (mappingMetaData == null) {
                  throw new IllegalArgumentException("Not found the mapping info of index: " + mapping.get_index());
              }
  
              fieldType = new LinkedHashMap<>();
  
              Map<String, Object> sourceMap = mappingMetaData.getSourceAsMap();
              Map<String, Object> esMapping = (Map<String, Object>) sourceMap.get("properties");
              for (Map.Entry<String, Object> entry : esMapping.entrySet()) {
                  Map<String, Object> value = (Map<String, Object>) entry.getValue();
                  if (value.containsKey("properties")) {
                      fieldType.put(entry.getKey(), "object");
                  } else {
                      fieldType.put(entry.getKey(), (String) value.get("type"));
                  }
              }
              esFieldTypes.put(key, fieldType);
          }
  
          return fieldType.get(fieldName);
      }