# Filtering search hits based on the presence of other search hits

**URL:** <https://discuss.elastic.co/t/filtering-search-hits-based-on-the-presence-of-other-search-hits/228935>\
**Category:** Elasticsearch\
**Created:** [April 20, 2020, 9:01pm UTC](https://discuss.elastic.co/t/filtering-search-hits-based-on-the-presence-of-other-search-hits/228935 "2020-04-20T21:01:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rrva](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rrva/32/43888_2.png) [@rrva](https://discuss.elastic.co/u/rrva)\
**Post date:** [April 20, 2020, 9:01pm UTC](https://discuss.elastic.co/t/filtering-search-hits-based-on-the-presence-of-other-search-hits/228935/1 "2020-04-20T21:01:58Z")

</div>

If my search in the first round returns search hits of a certain type (having an indexed field called "type" set to a specific value) , how can I make the presence of these search hits exclude other search hits which share common properties?

Lets say I have two types of documents, tv-shows and episodes, and when a search would result in hits for both the tv-shows and its episodes, and I want to remove the episode hits if the tv-show was among the results. Is this possible? Right now, no parent-child relationship is defined among these entities in the index.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 18, 2020, 9:02pm UTC](https://discuss.elastic.co/t/filtering-search-hits-based-on-the-presence-of-other-search-hits/228935/2 "2020-05-18T21:02:00Z")

</div>

Closed on May 18, 2020, 9:02pm UTC

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