[
https://issues.apache.org/jira/browse/FLINK-37265?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Zhang Hechuan updated FLINK-37265:
----------------------------------
Description:
"ElasticsearchEmitter" has 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}
was:
"ElasticsearchEmitter" has no method named "static", it should be
"static_index".
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_index('foo', 'id')) \
.set_hosts(['localhost:9200']) \
.build()
input.sink_to(es7_sink).name('es7 sink'){code}
> 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: 1.17.0, 1.18.0, 1.19.0, 1.20.0
> Reporter: Zhang Hechuan
> Priority: Minor
>
> "ElasticsearchEmitter" has 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)