# Is my index/ES install corrupt?

**URL:** <https://discuss.elastic.co/t/is-my-index-es-install-corrupt/137575>\
**Category:** Elasticsearch\
**Created:** [June 27, 2018, 8:49am UTC](https://discuss.elastic.co/t/is-my-index-es-install-corrupt/137575 "2018-06-27T08:49:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![TobyC](https://avatars.discourse-cdn.com/v4/letter/t/b19c9b/32.png) [@TobyC](https://discuss.elastic.co/u/TobyC)\
**Post date:** [June 27, 2018, 8:49am UTC](https://discuss.elastic.co/t/is-my-index-es-install-corrupt/137575/1 "2018-06-27T08:49:54Z")

</div>

Hey all,

I have a few indexes locally. I index a load of data and occasionally, an index seems to delete all but two documents.

This has happened a few times now to different indexes. There seems to be a mismatch in data. `_count` shows there are two results. `_search` shows there are two results. However `_cat/indices` says there are 536!

Has anyone had this issues before?

- I have tried restarting ES
- I have deleted the index and re-indexed

 ![06](https://us1.discourse-cdn.com/elastic/original/3X/3/9/3988fd42abd2102ee72274137e9773e7c76e6496.png)  
 ![50](https://us1.discourse-cdn.com/elastic/original/3X/a/7/a76116812e603ad397748b1c84be0777583e4527.png)

ES: 6.2.2  
OS: OSX 10.13.4

Thanks in advance

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [June 27, 2018, 8:52am UTC](https://discuss.elastic.co/t/is-my-index-es-install-corrupt/137575/2 "2018-06-27T08:52:16Z")

</div>

What is the query that returns a count of 2? Are you using nested objects in your mappings?

---

<div class="post-metadata">

**Author:** ![TobyC](https://avatars.discourse-cdn.com/v4/letter/t/b19c9b/32.png) [@TobyC](https://discuss.elastic.co/u/TobyC)\
**Post date:** [June 27, 2018, 8:53am UTC](https://discuss.elastic.co/t/is-my-index-es-install-corrupt/137575/3 "2018-06-27T08:53:44Z")

</div>

Thanks for the reply Christian.

`GET /wb_analytics/default/_count`

And also I get two results with

`GET /wb_analytics/default/_search`

And yeah, there a couple of nested objects. Could that be the issue?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [June 27, 2018, 8:55am UTC](https://discuss.elastic.co/t/is-my-index-es-install-corrupt/137575/4 "2018-06-27T08:55:53Z")

</div>

Nested objects are stored as separate documents behind the scenes, so would result in a higher count in the `_cat/indices` API.

---

<div class="post-metadata">

**Author:** ![TobyC](https://avatars.discourse-cdn.com/v4/letter/t/b19c9b/32.png) [@TobyC](https://discuss.elastic.co/u/TobyC)\
**Post date:** [June 27, 2018, 9:04am UTC](https://discuss.elastic.co/t/is-my-index-es-install-corrupt/137575/5 "2018-06-27T09:04:10Z")

</div>

Ahh OK, so there could be something wrong with my indexing then I guess. There are a lot of nested objects and a rough count up on one document gets me close to the total.

I bet that is it. Thanks for the pointer Christian. I'll report back once I have investigated.

Cheers

---

<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:** [July 25, 2018, 9:04am UTC](https://discuss.elastic.co/t/is-my-index-es-install-corrupt/137575/6 "2018-07-25T09:04:18Z")

</div>

Closed on July 25, 2018, 9:04am UTC

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