Sum_other_doc_count field in aggregations?

HI,

I have some documents in an index . To count the number of documents in an index i am using the following command:

GET data/_count
{
   "count": 390,
   "_shards": {
      "total": 5,
      "successful": 5,
      "failed": 0
   }
}

But when i used the following command to see all the indices it is showing stats like this

GET _cat/indices?v
health status index pri rep docs.count docs.deleted store.size pri.store.size 
green  open   data   5   1        791           65      6.1mb          2.9mb 

Why it is showing docs count as 791?

And when i use query to find all the values for a field it is showing different results

GET data/_search
{
       "size":0,
    "aggs" : {
        "codes" : {
            "terms" : {
                "field" : "university.code",
                "size" : 390
            }
        }
    }
}

Response:

"aggregations": {
      "codes": {
         "doc_count_error_upper_bound": 0,
         "sum_other_doc_count": 11,
         "buckets": [
            {
               "key": 3476,
               "doc_count": 1
            }, .....

In that above response i am seeing "sum_other_doc_count": 11. It means still there are 11 doc's in the index(i.e. 390+11=401 doc's)

When i given size field in aggregations to 0 (i.e.size:0). then it is showing the "sum_other_doc_count": 0

Why this is happening?

Thanks

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