Re: Upserts with Flink-elasticsearch

Posted by Hung on
URL: http://deprecated-apache-flink-user-mailing-list-archive.369.s1.nabble.com/Upserts-with-Flink-elasticsearch-tp5767p5787.html

Hi Zach,

For using upsert in ES2, I guess it looks like as follows? However I cannot find which method in Request returns UpdateRequest while Requests.indexRequest() returns IndexRequest. Can I ask did you know it?

public static UpdateRequest updateIndexRequest(String element) {
        Map<String, Object> json = new HashMap<>();
        json.put("data", element);        

       // Wrong call
        return Requests.updateRequest
                .index(index)
                .type(type)
                .id(element)
                .source(json);
    }

Best,

Sendoh