Count of hits in json different from reality


(bruno.dev) #1

Hi i have some query in kibana or using python script that have the same behaviour. the json answer contain max 10 fields while results appear to be 36 for instance. the hits structure contain only 10 answers ?
Someone know why ?:grinning:
thanks
{
"took": 391,
"timed_out": false,
"_shards": {
"total": 36,
** "successful": 36,**
"skipped": 0,
"failed": 0
},
"hits": {
"total": 38,
"max_score": 9.327275,
"hits": [
{


(Tim Roes) #2

Hi,

first: you highlighted two complete different "totals" up there. One of the totals, was inside the _shards object giving your information on how many shards that query hit, and how many of them returned a successful result.

The second total in hits is the actual total of documents, that would be returned. If you receive only 10 of those results, that's because you most likely haven't specified the size parameter. By default you will then only get the first 10 results of those total 38 results in your case.

You can increase the size parameter to get more results.

Cheers,
Tim


(bruno.dev) #3

thanks tim. done. :+1:


(system) #4

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