Without indexRequest ES2 throws `document does not exit exception`. Based on https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/java-docs-update.html#java-docs-update-api-upsert
the upsert works althrough not sure it's the best way. return new UpdateRequest() .index(sample_index) .type(sample_type) .id(String.valueOf(id)) .doc(json) .upsert(Requests.indexRequest() .index(sample_index) .type(sample_type) .id(String.valueOf(id)) .source(json)); Cheers, Hung -- View this message in context: http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/Upserts-with-Flink-elasticsearch-tp5767p5829.html Sent from the Apache Flink User Mailing List archive. mailing list archive at Nabble.com.