Hits.hits array empty even thought total =1

I have a node app using the javascript api.

even the the query returns a hit. I get the following response

"hits": {

  "total": 1,

  "max_score": 14.627042,

  "hits": []

}

how can the hits array be empty when the total shows 1.. If I run the query
in sense I get the expected result.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/26eca414-2963-4f11-be0b-f8a88c944bc3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Duh . my page started at 1 not 0.

On Tuesday, September 23, 2014 3:51:14 PM UTC-7, Stephen Ward wrote:

I have a node app using the javascript api.

even the the query returns a hit. I get the following response

"hits": {

  "total": 1,

  "max_score": 14.627042,

  "hits": []

}

how can the hits array be empty when the total shows 1.. If I run the
query in sense I get the expected result.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/af945b06-26fc-4598-9e80-7226c659f5ca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

By default, elasticsearch starts showing its Query results from pageNum as 0 and the search query we define generally start from pageNum as 1. Ensure that if you are setting the pageNum, it is set to 0 in case you have the resultset within the pageSize limit.

I was facing the same issue where I could see total_hits as 1 with empty array being returned. I found that I was setting the default pageNum to 1 ,however elasticsearch starts it from 0 and hence was returning the second page when queried with pageNum as 1

1 Like