title: Elasticsearch: upserts no longer support versions problem during migration ES from 5.6.16 to 6.8
body: <p>My use case is: I get a document from ES, process a time consuming operation, merge its results with the document and update document with the same version.
  I want to be sure that when I process the time consuming operation no other update will affect my document.</p>
  <p>I upgrade Elasticsearch from 5.6.16 to 6.8 and I have client 5.6.16.</p>
  <p>My code:</p>
  <pre><code>client.prepareUpdate(indexName, documentType, documentId)
                  .setRouting(sellerId)
                  .setDoc(jsonEntity, XContentType.JSON)
                  .setUpsert(jsonEntity, XContentType.JSON)
                  .setVersion(version)
                  .setVersionType(VersionType.INTERNAL)
                  .get();
  </code></pre>
  <p>During update ES throws an exception:</p>
  <pre><code>java.lang.IllegalArgumentException: Validation Failed: 1: can't provide both upsert request and a version;
  </code></pre>
  <p>In ES <a href="https://www.elastic.co/guide/en/elasticsearch/reference/6.8/breaking-changes-6.0.html#_link_linkend_upserts_upserts_link_no_longer_support_versions" rel="nofollow noreferrer">Breaking changes in 6.0</a> I found:</p>
  <p>&quot;Upserts no longer support versions. Adding a version to an upsert request is no longer supported.&quot;</p>
  <p>What should I use instead setting a version when I want to migrate to Elasticsearch 6.8?</p>