# Patching Discourse's search

**URL:** https://meta.discourse.org/t/patching-discourses-search/157156
**Category:** Development
**Created:** [July 8, 2020, 3:09pm UTC](https://meta.discourse.org/t/patching-discourses-search/157156 "2020-07-08T15:09:02Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [July 8, 2020, 6:24pm UTC](https://meta.discourse.org/t/patching-discourses-search/157156/2 "2020-07-08T18:24:17Z")

</div>

You can extend search from your plugin, for example you could add an advanced filter like this:

```ruby
  require_dependency 'search'
  if Search.respond_to? :advanced_filter
    Search.advanced_filter(/with:video/) do |posts|
      posts.where("posts.cooked LIKE '%<video %'")
    end
  end

```

The above will only display posts containing videos when the search box includes the `with:video` keyword. See also the [badge advanced filter](https://github.com/discourse/discourse/blob/master/lib/search.rb#L359-L359) for an example of a search query that takes user data into account.

---

_[View the full topic](https://meta.discourse.org/t/patching-discourses-search/157156)._
