# Using post filter to remove entries whereby collapsed inner hits total is less than X

**URL:** <https://discuss.elastic.co/t/using-post-filter-to-remove-entries-whereby-collapsed-inner-hits-total-is-less-than-x/371722>\
**Category:** Elasticsearch\
**Created:** [December 9, 2024, 6:54pm UTC](https://discuss.elastic.co/t/using-post-filter-to-remove-entries-whereby-collapsed-inner-hits-total-is-less-than-x/371722 "2024-12-09T18:54:43Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![carly.richmond](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carly.richmond/32/104935_2.png) [@carly.richmond](https://discuss.elastic.co/u/carly.richmond)\
**Post date:** [December 10, 2024, 8:40am UTC](https://discuss.elastic.co/t/using-post-filter-to-remove-entries-whereby-collapsed-inner-hits-total-is-less-than-x/371722/2 "2024-12-10T08:40:25Z")

</div>

Hi @codeMonkey82,

Thanks for raising your issue. It looks like it might be similar to the below issue:

> [@Applying post\_filter to limit inner\_hits in nested document](https://discuss.elastic.co/t/applying-post-filter-to-limit-inner-hits-in-nested-document/207925):
>
> Hi, I'm struggling how to apply a post\_filter to some nested documents. What I'd like to do is have some aggregation on all my nested documents, but have only certain nested documents returned (the general idea of a post\_filter). I'm succesfull in applying the post\_filter to filter out the root (parent)-documents, but not in filtering the inner hits on this document. As an example, I've created two documents that each contain 2 people (with a name and age), and what I'd like to have returned i…

Can you give the nested/ inner\_hits option a try and let us know if that resolves your issue?

---

_[View the full topic](https://discuss.elastic.co/t/using-post-filter-to-remove-entries-whereby-collapsed-inner-hits-total-is-less-than-x/371722)._
