Github user twalthr commented on a diff in the pull request:

    https://github.com/apache/flink/pull/6391#discussion_r204752713
  
    --- Diff: docs/dev/connectors/elasticsearch.md ---
    @@ -190,9 +220,30 @@ input.addSink(new ElasticsearchSink(config, 
transportAddresses, new Elasticsearc
     }))
     {% endhighlight %}
     </div>
    +<div data-lang="scala, Elasticsearch 6.x" markdown="1">
    +{% highlight scala %}
    +val input: DataStream[String] = ...
    +
    +val httpHosts = new java.util.ArrayList[HttpHost]
    +httpHosts.add(new HttpHost("127.0.0.1", 9300, "http"))
    +httpHosts.add(new HttpHost("10.2.3.1", 9300, "http"))
    +
    +input.addSink(new ElasticsearchSink(httpHosts, new 
ElasticsearchSinkFunction[String] {
    +  def createIndexRequest(element: String): IndexRequest = {
    +    val json = new java.util.HashMap[String, String]
    +    json.put("data", element)
    +    
    +    return Requests.indexRequest()
    +            .index("my-index")
    +            .type("my-type")
    +            .source(json)
    +  }
    +}))
    +{% endhighlight %}
    +</div>
     </div>
     
    -Note how a `Map` of `String`s is used to configure the `ElasticsearchSink`.
    +Note how `TransportClient` based version use a `Map` of `String`s is used 
to configure the `ElasticsearchSink`.
    --- End diff --
    
    Remove "is used to"?


---

Reply via email to