[ https://issues.apache.org/jira/browse/FLINK-37265 ]
Hirson Zhang deleted comment on FLINK-37265:
--------------------------------------
was (Author: JIRAUSER308616):
Hello, [~reswqa], could you please help me review this PR or find the person in
charge of it, thank you very much!
> Document of python elasticsearch connector exeample has a little mistake
> ------------------------------------------------------------------------
>
> Key: FLINK-37265
> URL: https://issues.apache.org/jira/browse/FLINK-37265
> Project: Flink
> Issue Type: Bug
> Components: API / DataStream, API / Python, Connectors /
> ElasticSearch
> Affects Versions: 2.0-preview
> Reporter: Hirson Zhang
> Priority: Minor
> Labels: pull-request-available
>
> There is no method named "ElasticsearchEmitter.static", it should be
> "ElasticsearchEmitter.static_index".
> Here is the code in the document now:
> Elasticsearch 7 static index:
> {code:java}
> from pyflink.datastream.connectors.elasticsearch import
> Elasticsearch7SinkBuilder, ElasticsearchEmitter
> env = StreamExecutionEnvironment.get_execution_environment()
> env.add_jars(ELASTICSEARCH_SQL_CONNECTOR_PATH)
> input = ...
> # The set_bulk_flush_max_actions instructs the sink to emit after every
> element, otherwise they would be buffered
> es7_sink = Elasticsearch7SinkBuilder() \
> .set_bulk_flush_max_actions(1) \
> .set_emitter(ElasticsearchEmitter.static('foo', 'id')) \
> .set_hosts(['localhost:9200']) \
> .build()
> input.sink_to(es7_sink).name('es7 sink'){code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)