# The question on search: docs.count not equal hits.total

**URL:** https://discuss.elastic.co/t/the-question-on-search-docs-count-not-equal-hits-total/19356
**Category:** Elasticsearch
**Created:** [August 20, 2014, 3:27am UTC](https://discuss.elastic.co/t/the-question-on-search-docs-count-not-equal-hits-total/19356 "2014-08-20T03:27:12Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Arvin\_Wong](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/arvin_wong/32/25018_2.png) [@Arvin\_Wong](https://discuss.elastic.co/u/Arvin_Wong)
#### Post date: [August 20, 2014, 3:27am UTC](https://discuss.elastic.co/t/the-question-on-search-docs-count-not-equal-hits-total/19356/1 "2014-08-20T03:27:12Z")

</div>

Hi,  
When I scan my indices, it shows that:

```
 health                                        

```

index pri rep docs.count  
docs.deleted store.size pri.store.size  
green flume-2014-08-19-content-news  
5 1 5849 0  
36.4mb 18.4mb

```
And, I scan the total document in flume-2014-08-19-content-new, it 

```

shows that:

```
$ curl -XGET 

```

'localhost:9200/flume-2014-08-19-content-news/\_search?pretty'  
{  
"took" : 6,  
"timed\_out" : false,  
"\_shards" : {  
"total" : 5,  
"successful" : 5,  
"failed" : 0  
},  
"hits" : {  
"total" : 1658,  
"max\_score" : 1.0,

We just add data to this index, BUT the two number is different.  
I have no diea about it. Who can tell me why.

Many thanks.

--  
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/48e8abc4-37ca-4a64-b63f-d75a5ec97589%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/48e8abc4-37ca-4a64-b63f-d75a5ec97589%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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: [August 20, 2014, 6:03am UTC](https://discuss.elastic.co/t/the-question-on-search-docs-count-not-equal-hits-total/19356/2 "2014-08-20T06:03:28Z")

</div>

You probably updates some docs, right?

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

> Le 20 août 2014 à 05:27, Arvin Wong [wmx3ng@gmail.com](mailto:wmx3ng@gmail.com) a écrit :
> 
> Hi,  
> When I scan my indices, it shows that:
> 
> ```
> health index pri rep docs.count docs.deleted store.size pri.store.size 
> green flume-2014-08-19-content-news 5 1 5849 0 36.4mb 18.4mb 
> 
> And, I scan the total document in flume-2014-08-19-content-new, it shows that:
> 
> $ curl -XGET 'localhost:9200/flume-2014-08-19-content-news/_search?pretty'
> 
> ```
> 
> {  
> "took" : 6,  
> "timed\_out" : false,  
> "\_shards" : {  
> "total" : 5,  
> "successful" : 5,  
> "failed" : 0  
> },  
> "hits" : {  
> "total" : 1658,  
> "max\_score" : 1.0,
> 
> We just add data to this index, BUT the two number is different.  
> I have no diea about it. Who can tell me why.
> 
> Many thanks.
> 
> --  
> 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/48e8abc4-37ca-4a64-b63f-d75a5ec97589%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/48e8abc4-37ca-4a64-b63f-d75a5ec97589%40googlegroups.com).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/AEB9230D-4472-41B9-93C1-50F8BBAC2AA4%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/AEB9230D-4472-41B9-93C1-50F8BBAC2AA4%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![vineeth\_mohan\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vineeth_mohan_2/32/747_2.png) [@vineeth\_mohan\_2](https://discuss.elastic.co/u/vineeth_mohan_2)
#### Post date: [August 20, 2014, 6:05am UTC](https://discuss.elastic.co/t/the-question-on-search-docs-count-not-equal-hits-total/19356/3 "2014-08-20T06:05:11Z")

</div>

Hello Arvin ,

This can also happen when you have nested types.  
docs.count would be total of documents including nested ones.

Thanks  
Vineeth

On Wed, Aug 20, 2014 at 8:57 AM, Arvin Wong [wmx3ng@gmail.com](mailto:wmx3ng@gmail.com) wrote:

> Hi,  
> When I scan my indices, it shows that:
> 
> ```
> health
> 
> ```
> 
> index pri rep docs.count  
> docs.deleted store.size pri.store.size  
> green flume-2014-08-19-content-news  
> 5 1 5849 0  
> 36.4mb 18.4mb
> 
> ```
> And, I scan the total document in flume-2014-08-19-content-new, it
> 
> ```
> 
> shows that:
> 
> ```
> $ curl -XGET
> 
> ```
> 
> 'localhost:9200/flume-2014-08-19-content-news/\_search?pretty'  
> {  
> "took" : 6,  
> "timed\_out" : false,  
> "\_shards" : {  
> "total" : 5,  
> "successful" : 5,  
> "failed" : 0  
> },  
> "hits" : {  
> "total" : 1658,  
> "max\_score" : 1.0,
> 
> We just add data to this index, BUT the two number is different.  
> I have no diea about it. Who can tell me why.
> 
> Many thanks.
> 
> --  
> 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/48e8abc4-37ca-4a64-b63f-d75a5ec97589%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/48e8abc4-37ca-4a64-b63f-d75a5ec97589%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/48e8abc4-37ca-4a64-b63f-d75a5ec97589%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/48e8abc4-37ca-4a64-b63f-d75a5ec97589%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/CAGdPd5mGhObP1MK1V7EtymLEWDvCiYDEPUAbTL59rHVbGPhQ5g%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGdPd5mGhObP1MK1V7EtymLEWDvCiYDEPUAbTL59rHVbGPhQ5g%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Arvin\_Wong](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/arvin_wong/32/25018_2.png) [@Arvin\_Wong](https://discuss.elastic.co/u/Arvin_Wong)
#### Post date: [August 20, 2014, 6:32am UTC](https://discuss.elastic.co/t/the-question-on-search-docs-count-not-equal-hits-total/19356/4 "2014-08-20T06:32:12Z")

</div>

That's it . I'm 'Too Y Too S'. Thank you Very Much.

在 2014年8月20日星期三UTC+8下午2时05分28秒，vineeth mohan写道：

> Hello Arvin ,
> 
> This can also happen when you have nested types.  
> docs.count would be total of documents including nested ones.
> 
> Thanks  
> Vineeth
> 
> On Wed, Aug 20, 2014 at 8:57 AM, Arvin Wong \<[wmx...@gmail.com](mailto:wmx...@gmail.com)  
> \<javascript:\>\> wrote:
> 
> > Hi,  
> > When I scan my indices, it shows that:
> > 
> > ```
> > health                                        
> > 
> > ```
> > 
> > index pri rep docs.count  
> > docs.deleted store.size pri.store.size  
> > green flume-2014-08-19-content-news  
> > 5 1 5849 0  
> > 36.4mb 18.4mb
> > 
> > ```
> > And, I scan the total document in flume-2014-08-19-content-new, it 
> > 
> > ```
> > 
> > shows that:
> > 
> > ```
> > $ curl -XGET 
> > 
> > ```
> > 
> > 'localhost:9200/flume-2014-08-19-content-news/\_search?pretty'  
> > {  
> > "took" : 6,  
> > "timed\_out" : false,  
> > "\_shards" : {  
> > "total" : 5,  
> > "successful" : 5,  
> > "failed" : 0  
> > },  
> > "hits" : {  
> > "total" : 1658,  
> > "max\_score" : 1.0,
> > 
> > We just add data to this index, BUT the two number is different.  
> > I have no diea about it. Who can tell me why.
> > 
> > Many thanks.
> > 
> > --  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/48e8abc4-37ca-4a64-b63f-d75a5ec97589%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/48e8abc4-37ca-4a64-b63f-d75a5ec97589%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/48e8abc4-37ca-4a64-b63f-d75a5ec97589%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/48e8abc4-37ca-4a64-b63f-d75a5ec97589%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/a8b3c699-ce55-4890-a7ea-6e99bfa24b9e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a8b3c699-ce55-4890-a7ea-6e99bfa24b9e%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:07am UTC](https://discuss.elastic.co/t/the-question-on-search-docs-count-not-equal-hits-total/19356/5 "2017-07-06T01:07:31Z")

</div>


