[
https://issues.apache.org/jira/browse/FLINK-13519?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Chesnay Schepler closed FLINK-13519.
------------------------------------
Fix Version/s: 1.10.0
Resolution: Fixed
master: 1cf261e64ff24165f5758263a1e86f38571e32b8
> Elasticsearch Connector sample code for Scala on version 6.x will not work
> --------------------------------------------------------------------------
>
> Key: FLINK-13519
> URL: https://issues.apache.org/jira/browse/FLINK-13519
> Project: Flink
> Issue Type: Bug
> Components: Connectors / ElasticSearch, Documentation
> Affects Versions: 1.7.2, 1.8.0, 1.8.1
> Reporter: Alberto Romero
> Assignee: Alberto Romero
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.10.0
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> The Scala example in the documentation for the Elasticsearch Connector,
> version 6.x, will not work. The class ElasticsearchSinkFunction[String]
> requires a RuntimeContext and a RequestIndexer, which the example omits.
> Also, *_type_* needs to be in inverse quotes as it's a Scala keyword.
> It should look like the following:
> {code:java}
> def process(element: String, ctx: RuntimeContext, indexer: RequestIndexer) {
> val json = new java.util.HashMap[String, String]
> json.put("data", element)
> val rqst: IndexRequest = Requests.indexRequest
> .index("testarindex")
> .`type`("_doc")
> .source(json)
> indexer.add(rqst)
> }{code}
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)