# Cross-Cluster document deletes

**URL:** <https://discuss.elastic.co/t/cross-cluster-document-deletes/119106>\
**Category:** Elasticsearch\
**Created:** [February 8, 2018, 6:53pm UTC](https://discuss.elastic.co/t/cross-cluster-document-deletes/119106 "2018-02-08T18:53:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gansvv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gansvv/32/23904_2.png) [@gansvv](https://discuss.elastic.co/u/gansvv)\
**Post date:** [February 8, 2018, 6:53pm UTC](https://discuss.elastic.co/t/cross-cluster-document-deletes/119106/1 "2018-02-08T18:53:23Z")

</div>

I have multiple ES clusters indexing data and cross-cluster search helps to retrieve documents from all clusters. Now, I would like to delete a few documents and need to delete from multiple clusters. However I get the following error when I use "remote-index-name:index-name" in the delete\_by\_query API's index name:  
`version conflict, current version [-1] is different than the one provided [2]`

The version I get from the second cluster is 2. How does ES get version -1 in this case (is this an bug in cluster-wide settings?)

My delete call is like so:  
curl -sX POST 'localhost:9200/remote-cluster-\*:my-index/\_delete\_by\_query?pretty' -H "Content-Type: application/json" -H "Accept: application/json" --data "@params.json"

And I have remote-cluster-1, remote-cluster-2, and remote-cluster-3 defined in persistent settings for cross-cluster search.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [February 9, 2018, 1:50am UTC](https://discuss.elastic.co/t/cross-cluster-document-deletes/119106/2 "2018-02-09T01:50:32Z")

</div>

What version are you on? Can you post the entire command and output?

---

<div class="post-metadata">

**Author:** ![gansvv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gansvv/32/23904_2.png) [@gansvv](https://discuss.elastic.co/u/gansvv)\
**Post date:** [February 12, 2018, 6:20pm UTC](https://discuss.elastic.co/t/cross-cluster-document-deletes/119106/3 "2018-02-12T18:20:53Z")

</div>

I am using Elasticsearch 6.1.1.

The \_search query is for a single field (name=request\_count) and for search response there are two entries returned from two clusters. However both have timestamps which are different, and the version is also different (1,2). Hence search listing works, but delete does not.  
Is cross-cluster query not supposed to work for deleting records? Why does it have a -1 version?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 12, 2018, 6:21pm UTC](https://discuss.elastic.co/t/cross-cluster-document-deletes/119106/4 "2018-03-12T18:21:05Z")

</div>

Closed on March 12, 2018, 6:21pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
