flink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aljoscha Krettek <aljos...@apache.org>
Subject Re: Upserts with Flink-elasticsearch
Date Thu, 31 Mar 2016 08:42:21 GMT
@suneel if it is possible to add upsert support for ES 1.x I would go for
it, yes.

On Tue, 29 Mar 2016 at 16:36 Zach Cox <zcox522@gmail.com> wrote:

> You can just create a new UpdateRequest instance directly using its
> constructor [1] like this:
>
>         return new UpdateRequest()
>                 .index(index)
>                 .type(type)
>                 .id(element)
>                 .source(json);
>
> [1]
> http://javadoc.kyubu.de/elasticsearch/HEAD/org/elasticsearch/action/update/UpdateRequest.html
>
>
> On Tue, Mar 29, 2016 at 8:28 AM HungChang <unicorn.banachi@gmail.com>
> wrote:
>
>> 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
>>
>>
>>
>> --
>> View this message in context:
>> http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/Upserts-with-Flink-elasticsearch-tp5767p5787.html
>> Sent from the Apache Flink User Mailing List archive. mailing list
>> archive at Nabble.com.
>>
>

Mime
View raw message