@Override public String writeDocument(Map.Entry<String, String> input,
        ByteBufOutputStream sink) {
        try (JsonGenerator writer = JsonSerializers.jsonGenerator(sink)) {
          writeAutocompleteEntry(input.getKey(), input.getValue(), writer);
        } catch (IOException e) {
          throw new AssertionError("Couldn't close generator for a memory stream.", e);
        }
        // Id is used to dedupe server side as necessary. Arbitrarily same format as _q value.
        return input.getKey() + '=' + input.getValue();
      }
Write a complete json document according to index strategy and returns the ID field.
zipkin-storage/elasticsearch/src/main/java/zipkin2/elasticsearch/internal/BulkIndexWriter.java