# Nested object docs.count anomaly

**URL:** https://discuss.elastic.co/t/nested-object-docs-count-anomaly/21529
**Category:** Elasticsearch
**Created:** [January 8, 2015, 5:53am UTC](https://discuss.elastic.co/t/nested-object-docs-count-anomaly/21529 "2015-01-08T05:53:07Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![cto](https://avatars.discourse-cdn.com/v4/letter/c/5daacb/32.png) [@cto](https://discuss.elastic.co/u/cto)
#### Post date: [January 8, 2015, 5:53am UTC](https://discuss.elastic.co/t/nested-object-docs-count-anomaly/21529/1 "2015-01-08T05:53:07Z")

</div>

Hi,

I have a nested object JSON which I am inserting into the Elasticsearch  
1.4.0.  
The nested object mapping is as follows:-

{  
"mappings": {  
"observations": {  
"properties": {  
"attribute": {  
"type": "nested",  
"properties": {  
"name": {"type": "string"},  
"value": {"type": "string"},  
"type": {"type": "string"}  
}  
}  
}  
}  
}  
}

For testing, I inserted _50,000_ of such observations JSON documents(each  
with _5 attributes_) in Elasticsearch three times. Testing environment is  
the same for all the three cases.

The output of the " \*GET /\_cat/indices?v \*" command is given below.

_Test Case - 1_  
health status index pri rep docs.count docs.deleted store.size  
pri.store.size  
green open nested 1 0 \*299960 \* 0 _16.3mb_  
16.3mb

_Test Case - 2_  
health status index pri rep docs.count docs.deleted store.size  
pri.store.size  
green open nested 1 0 _299997_ 0 _9.4mb_  
9.4mb

_Test Case - 3_  
health status index pri rep docs.count docs.deleted store.size  
pri.store.size  
green open nested 1 0 _300000_ 0 9.4mb  
9.4mb

In all the three cases, the docs.count is different. Also, there is a  
difference in the storage sizes.  
Are data points getting lost??

My target is to store 1,000,000 data points or more. This can cause issues  
as the data points grows.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/4947b8f0-4318-4b09-abe9-31f6846e1e36%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/4947b8f0-4318-4b09-abe9-31f6846e1e36%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![sumit\_gupta\_sgt](https://avatars.discourse-cdn.com/v4/letter/s/dec6dc/32.png) [@sumit\_gupta\_sgt](https://discuss.elastic.co/u/sumit_gupta_sgt)
#### Post date: [January 8, 2015, 6:14am UTC](https://discuss.elastic.co/t/nested-object-docs-count-anomaly/21529/2 "2015-01-08T06:14:58Z")

</div>

Hi,

Can you please first do optimize then do count query.  
If this count and size is still inconsistent please let me know.

Thanks,  
Sumit

---

<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 6, 2017, 12:40am UTC](https://discuss.elastic.co/t/nested-object-docs-count-anomaly/21529/3 "2017-07-06T00:40:12Z")

</div>


