Completable create(Map<String, String> mapping) {
    Objects.requireNonNull(mapping, "mapping");

    ObjectNode mappings = mapper.createObjectNode();

    ObjectNode properties = mappings.with("mappings").with("properties");
    for (Map.Entry<String, String> entry: mapping.entrySet()) {
      applyMapping(properties, entry.getKey(), entry.getValue());
    }

    // create index and mapping
    try {
      final HttpEntity entity = new StringEntity(mapper.writeValueAsString(mappings),
              ContentType.APPLICATION_JSON);
      final Request r = new Request("PUT", "/" + index);
      r.setEntity(entity);
      return transport.execute(r).ignoreElement();
    } catch (JsonProcessingException e) {
      throw new UncheckedIOException(e);
    }
  }
Creates index in elastic search given a mapping. Mapping can contain nested fields expressed
as dots({@code .}).

<p>Example
<pre>
 {@code
    b.a: long
    b.b: keyword
 }
</pre>

@param mapping field and field type mapping
@throws IOException if there is an error
criteria/elasticsearch/src/org/immutables/criteria/elasticsearch/IndexOps.java