Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Elasticsearch significant terms aggregation: meaning of doc_count and bg_count

I am having trouble finding documentation to explain the doc_count and bg_count fields in the response to the significant terms aggregation.

For example I would expect that, if I do not set a background filter, the bg_count should the the total number of documents in the index. However what I see is that the bg_count is not the same for each result, and it isn't anywhere near the total number of documents.

I assume that doc_count is the number of documents containing the returned key.

What is the actual meaning of these values? Where can I find more complete documentation for that?

like image 334
Metropolis Avatar asked Oct 27 '25 03:10

Metropolis


1 Answers

Very simply:

  • doc_count is the number of documents in the result set with the given term
  • bg_count is the number of documents in the whole index with the given term
like image 183
Val Avatar answered Oct 28 '25 18:10

Val



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!