I come to know there is an <b>UpdateRequest is availble in ES version0.19.0</b>, and i can use it like
UpdateRequest updateRequest = new UpdateRequest(indexName,indexType,indexId); client.update(updateRequest);
and I am not sure how to pass the updated source to do updateIndex.
so far I am doing update index by the below steps in ES version 0.18.7 by
GetRequest getRequest = new GetRequest(indexName,indexType, indexId);
GetResponse response = client.get(getRequest).get();
//document already existing in the elastic search engine
3 .Map<String, Object> responseSourceMap = response.getSource();
responseSourceMap .put(document to update);
create a indexrequest with source as responseSourceMap
client.index(indexRequest);
I have a question of what is the advantage of using client.update(updateRequest) instead of client.index(indexRequest) and how to use properly client.update(updateRequest)?
Please share your thoughts.
On Tuesday, April 24, 2012 7:26:32 AM UTC-4, Periyandavar wrote:
Dear Elastic Search User,
I come to know there is an *UpdateRequest is availble in ES
version0.19.0*, and i can use it like
UpdateRequest updateRequest = new
UpdateRequest(indexName,indexType,indexId); client.update(updateRequest);
and I am not sure how to pass the updated source to do updateIndex.
so far I am doing update index by the below steps in* ES version 0.18.7* by
GetRequest getRequest = new GetRequest(indexName,indexType, indexId);
GetResponse response = client.get(getRequest).get();
//document already existing in the Elasticsearch engine
3 .Map<String, Object> responseSourceMap = response.getSource();
responseSourceMap .put(document to update);
create a indexrequest with source as responseSourceMap
client.index(indexRequest);
I have a question of what is the advantage of using client.update(updateRequest) instead of client.index(indexRequest) and how to use properly client.update(updateRequest)?
Please share your thoughts.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.