How to get correct count in aggregations

The count in aggregation is different than the documents matching on the aggregated value. Is there any correct way to get exact count of aggregation values.
Example:

"aggregations" : {
    "profiles" : {
      "doc_count" : 58457141,
      "ctc" : {
        "doc_count" : 684,
        "filtered_aggs" : {
          "buckets" : [
            {
              "key" : "8633.088-17266.176",
              "from" : 8633.088,
              "to" : 17266.176,
              "doc_count" : 684,
              "users_count" : {
                "doc_count" : 651
              }
            }
          ]
        }
      }
    }
  }

so in this bucket "8633.088-17266.176" there are 651 docs, but when I actually filter out the docs on this range, number of results appers to be less.

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