code: public static void createMapping(RestHighLevelClient client, String root, String index, boolean merge)
              throws Exception {
          String mapping = TypeSettingsReader.readMapping(root, index);
          if (mapping != null) {
              createMappingWithJson(client, index, mapping, merge);
          }
      }
docs: Create a new type in Elasticsearch
  @param client Elasticsearch client
  @param root dir within the classpath
  @param index Index name
  @param merge Try to merge mapping if type already exists
  @throws Exception if the elasticsearch call is failing