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.
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.