# Delete by query is not deleting all the docs and still index doc count shows same

**URL:** <https://discuss.elastic.co/t/delete-by-query-is-not-deleting-all-the-docs-and-still-index-doc-count-shows-same/127277>\
**Category:** Elasticsearch\
**Created:** [April 9, 2018, 8:36am UTC](https://discuss.elastic.co/t/delete-by-query-is-not-deleting-all-the-docs-and-still-index-doc-count-shows-same/127277 "2018-04-09T08:36:21Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 10, 2018, 6:50am UTC](https://discuss.elastic.co/t/delete-by-query-is-not-deleting-all-the-docs-and-still-index-doc-count-shows-same/127277/12 "2018-04-10T06:50:31Z")

</div>

Read [this](https://discuss.elastic.co/t/about-the-elasticsearch-category/21) and specifically the "Also be patient" part.

It's fine to answer on your own thread after 2 or 3 days (not including weekends) if you don't have an answer.

> what is the difference between the doc.count from '\_cat/indices' and 'cscfcounter/\_search?routing=1'

The later counts documents that are available for search from one single shard (the shard which correspond to routing key = `1`).  
IIRC the former counts the documents that have been indexed (including documents that have been removed may be)

> To add in golang where can i get the API list? and i understand that i have missed to 'routing' the in delete\_by\_query. So is it possible to add in golang syntax.?

I don't know. I don't know the go client.

In the first place, why are you using routing?

---

_[View the full topic](https://discuss.elastic.co/t/delete-by-query-is-not-deleting-all-the-docs-and-still-index-doc-count-shows-same/127277)._
