Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.7.2, 1.8.0, 1.8.1
Description
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:
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) }
Attachments
Issue Links
- links to