# Total hits shows 1 and hits array is 0 length

**URL:** https://discuss.elastic.co/t/total-hits-shows-1-and-hits-array-is-0-length/3052
**Category:** Elasticsearch
**Created:** [June 29, 2010, 8:26pm UTC](https://discuss.elastic.co/t/total-hits-shows-1-and-hits-array-is-0-length/3052 "2010-06-29T20:26:05Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Samuel\_Doyle](https://avatars.discourse-cdn.com/v4/letter/s/e19adc/32.png) [@Samuel\_Doyle](https://discuss.elastic.co/u/Samuel_Doyle)
#### Post date: [June 29, 2010, 8:26pm UTC](https://discuss.elastic.co/t/total-hits-shows-1-and-hits-array-is-0-length/3052/1 "2010-06-29T20:26:05Z")

</div>

I just did a test where I encountered this. I was asserting on the hit count  
which was 1 but there this is no results in the hits.  
Any ideas why this is happening?

Thanks

---

<div class="post-metadata">

### Author: ![Lukas\_Vlcek1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas_vlcek1/32/819_2.png) [@Lukas\_Vlcek1](https://discuss.elastic.co/u/Lukas_Vlcek1)
#### Post date: [June 29, 2010, 8:53pm UTC](https://discuss.elastic.co/t/total-hits-shows-1-and-hits-array-is-0-length/3052/2 "2010-06-29T20:53:05Z")

</div>

Any chance you can share the test?

Lukas

On Tue, Jun 29, 2010 at 10:26 PM, Samuel Doyle [samueldoyle@gmail.com](mailto:samueldoyle@gmail.com)wrote:

> I just did a test where I encountered this. I was asserting on the hit  
> count which was 1 but there this is no results in the hits.  
> Any ideas why this is happening?
> 
> Thanks

---

<div class="post-metadata">

### Author: ![Samuel\_Doyle](https://avatars.discourse-cdn.com/v4/letter/s/e19adc/32.png) [@Samuel\_Doyle](https://discuss.elastic.co/u/Samuel_Doyle)
#### Post date: [June 29, 2010, 9:32pm UTC](https://discuss.elastic.co/t/total-hits-shows-1-and-hits-array-is-0-length/3052/3 "2010-06-29T21:32:57Z")

</div>

There is a bit involved in the setup atm I would need to strip out, the one  
hit is expected in this case then I follow up with a case where I don't  
expect any hits and in that case I have 0 for the hitcount and a 0 length  
array which I would expect.

On Tue, Jun 29, 2010 at 1:53 PM, Lukáš Vlček [lukas.vlcek@gmail.com](mailto:lukas.vlcek@gmail.com) wrote:

> Any chance you can share the test?
> 
> Lukas
> 
> On Tue, Jun 29, 2010 at 10:26 PM, Samuel Doyle [samueldoyle@gmail.com](mailto:samueldoyle@gmail.com)wrote:
> 
> > I just did a test where I encountered this. I was asserting on the hit  
> > count which was 1 but there this is no results in the hits.  
> > Any ideas why this is happening?
> > 
> > Thanks

---

<div class="post-metadata">

### Author: ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)
#### Post date: [June 30, 2010, 9:06am UTC](https://discuss.elastic.co/t/total-hits-shows-1-and-hits-array-is-0-length/3052/4 "2010-06-30T09:06:45Z")

</div>

On Tue, 2010-06-29 at 13:26 -0700, Samuel Doyle wrote:

> I just did a test where I encountered this. I was asserting on the hit  
> count which was 1 but there this is no results in the hits.  
> Any ideas why this is happening?

Do you see this consistently? What version are you using? and how many  
nodes?

I've seen similar issues, but I can't reproduce them. They just happen  
every now and again. I'm running 0.8 with two nodes.

I very occasionally see the wrong results being returned in a search,  
like ES has sent a request out to its nodes, then recombined the  
responses into the incorrect query.

ï»¿ï»¿[Issues · elastic/elasticsearch · GitHub](http://github.com/elasticsearch/elasticsearch/issues#issue/198)

clint

> Thanks  
> --  
> Web Announcements Limited is a company registered in England and Wales,  
> with company number 05608868, with registered address at 10 Arvon Road,  
> London, N5 1PR.

---

<div class="post-metadata">

### Author: ![Samuel\_Doyle](https://avatars.discourse-cdn.com/v4/letter/s/e19adc/32.png) [@Samuel\_Doyle](https://discuss.elastic.co/u/Samuel_Doyle)
#### Post date: [June 30, 2010, 9:26am UTC](https://discuss.elastic.co/t/total-hits-shows-1-and-hits-array-is-0-length/3052/5 "2010-06-30T09:26:57Z")

</div>

I was seeing this off a master build and it would only happen when  
connecting to a running instance if I ran local for integration testing it  
was fine. I was only running one node when I was encountering it.

As it turns out though I did an update, clean build and deploy and was not  
able to reproduce since and yes I was consistently seeing it happen. Perhaps  
a lib was out of sync. or something but I am happy I haven't encountered it  
again.

On Wed, Jun 30, 2010 at 2:06 AM, Clinton Gormley [clinton@iannounce.co.uk](mailto:clinton@iannounce.co.uk)wrote:

> On Tue, 2010-06-29 at 13:26 -0700, Samuel Doyle wrote:
> 
> > I just did a test where I encountered this. I was asserting on the hit  
> > count which was 1 but there this is no results in the hits.  
> > Any ideas why this is happening?
> 
> Do you see this consistently? What version are you using? and how many  
> nodes?
> 
> I've seen similar issues, but I can't reproduce them. They just happen  
> every now and again. I'm running 0.8 with two nodes.
> 
> I very occasionally see the wrong results being returned in a search,  
> like ES has sent a request out to its nodes, then recombined the  
> responses into the incorrect query.
> 
> [Issues · elastic/elasticsearch · GitHub](http://github.com/elasticsearch/elasticsearch/issues#issue/198)
> 
> clint
> 
> > Thanks  
> > --  
> > Web Announcements Limited is a company registered in England and Wales,  
> > with company number 05608868, with registered address at 10 Arvon Road,  
> > London, N5 1PR.

---

<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, 4:22am UTC](https://discuss.elastic.co/t/total-hits-shows-1-and-hits-array-is-0-length/3052/6 "2017-07-06T04:22:53Z")

</div>


