[ 
https://issues.apache.org/jira/browse/FLINK-37265?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]
Zhang Hechuan updated FLINK-37265:
----------------------------------
    Affects Version/s:     (was: 1.17.0)
                           (was: 1.18.0)
                           (was: 1.19.0)
                           (was: 1.20.0)

> document of python elasticsearch connector exeample has a 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: Zhang Hechuan
>            Priority: Minor
>
> There is no method named "ElasticsearchEmitter.static", it should be 
> "ElasticsearchEmitter.static_index".
> Here is the code in the document:
> 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)

Reply via email to