Issue with UpdateRequest

Hi,
I am struggling to get UpdateRequest working, but got stuck with this:

UpdateRequest request = new UpdateRequest("index", "type",
"key").upsert(values);

Here, i have change values (HashMap) and tried to execute using
BulkRequestBuilder. I am not getting any error, but it's not updating data
as well!

Any suggestions?

-Vivek

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

You should use the doc method instead of the upsert method. Like this:
UpdateRequest request = new UpdateRequest("index", "type",
"key").doc(values);

And then you can just execute it:
UpdateResponse response = client.update(request).actionGet();

The upsert is used in the case if a document doesn't exist. Whatever has
been specified in the upsert will be used to insert a new document.
If the document you try to update exists, then the doc is used to merge the
changes into the document you are updating.

On 30 August 2013 12:57, Vivek Mishra mishra.vivs@gmail.com wrote:

Hi,
I am struggling to get UpdateRequest working, but got stuck with this:

UpdateRequest request = new UpdateRequest("index", "type",
"key").upsert(values);

Here, i have change values (HashMap) and tried to execute using
BulkRequestBuilder. I am not getting any error, but it's not updating data
as well!

Any suggestions?

-Vivek

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
Met vriendelijke groet,

Martijn van Groningen

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.