[
https://issues.apache.org/jira/browse/FLINK-13519?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Chesnay Schepler updated FLINK-13519:
-------------------------------------
Component/s: Connectors / ElasticSearch
> 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
> Time Spent: 10m
> 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)