# Search filter - only topics / only posts

**URL:** https://meta.discourse.org/t/search-filter-only-topics-only-posts/257994
**Category:** Feature
**Tags:** search
**Created:** [March 13, 2023, 5:27pm UTC](https://meta.discourse.org/t/search-filter-only-topics-only-posts/257994 "2023-03-13T17:27:56Z")
**Posts on this page:** 1
**Showing post:** 7

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [March 13, 2023, 11:40pm UTC](https://meta.discourse.org/t/search-filter-only-topics-only-posts/257994/7 "2023-03-13T23:40:44Z")

</div>

It’s an unknown, strange and terrifying world for me, but looking at the code, the controller would be here:

> <https://github.com/discourse/discourse/blob/2c8dfc3dbc401074e91d930dafe98f38c88a396f/app/controllers/search_controller.rb>

The search filters seem to be here:

> <https://github.com/discourse/discourse/blob/60ad836313b15eb8072bfadcbf657d5275754fde/lib/search.rb#L358>

And you may be interested to see how [Discours Assign](https://meta.discourse.org/t/discourse-assign/58044) adds a filter to the search:

> <https://github.com/discourse/discourse-assign/blob/99e5bb48c907e47ce798fcbe097f9c4a98b0c1ad/plugin.rb#L932>

---

_[View the full topic](https://meta.discourse.org/t/search-filter-only-topics-only-posts/257994)._
