@stefan I’m curious, how would you accomplish this in Elasticsearch? If you apply a filter on a field and also a terms aggregation on the same field, I believe that would result in just the counts for the current result set. So going back to the original example, it would end up looking something like:
=== Document Type ===
[x] PDF (96)
@micah.herstand Are you using App Search or Site Search? There is a solution for this with App Search, called “Disjunctive Faceting”. It will run separate queries, as you describe @micah.herstand, to achieve this automatically. It leverages caching to reduce additional network traffic this causes.