Searching for content effectively

:bookmark: This guide provides a comprehensive overview of Discourse’s search capabilities, including filters, options, and advanced techniques.

:person_raising_hand: Required user level: All users

Discourse offers a powerful search functionality with numerous filters and criteria. When you use the advanced search form, it automatically appends the relevant syntax to your query. For example, selecting [x] In my messages will add in:personal to your search query.

This guide covers all available search options and features in Discourse, and provides useful tips and tricks for using the search function.

Filters

Discourse provides a wide range of filters to help you refine your search results. Here’s a comprehensive list of available filters:

Search Scope Filters

Syntax Description
in:title Returns topics with the search term in the title
in:first Returns only first posts in topics
in:replies Returns only posts that are replies, excludes topic OPs
in:all-posts Returns every post that matches the query, even when multiple posts match within the same topic
in:all Returns posts from public topics and personal messages
in:personal Searches within your personal messages
in:personal-direct Returns posts in personal messages between two users only
in:all-pms :information_source: For Admins only
Returns posts from all personal messages, including those you’re not a part of
topic:topic_id Returns posts within a specific topic
include:unlisted :information_source: For Trust Level 4 and staff only
Returns posts, including those from unlisted topics

Post Type Filters

Syntax Description
in:regular Returns regular posts only (excludes whispers, small action posts, and staff-colored posts)
in:whisper :information_source: For users with whisper access only
Returns whisper posts
in:pinned Returns posts from pinned topics
in:wiki Returns wiki posts
with:images Returns posts containing images
in:bot Returns posts by bot users
in:human Returns posts by human users

User and Group Filters

Syntax Description
@username Returns posts by username
user:username Returns posts by username
created:@username Returns posts from topics created by username
group:group_name Returns posts from users within the group_name group
group_messages:group_name Returns posts from personal messages sent to the group_name group
personal_messages:username :information_source: For Admins only
Returns posts from personal messages of the specified user
badge:name_or_id Returns posts linked to a specific badge grant

User-Specific Filters (Logged-In)

Syntax Description
in:seen Returns posts you’ve seen
in:unseen Returns posts you haven’t seen
in:watching Returns posts from topics you’re watching
in:tracking Returns posts from topics you’re tracking
in:bookmarks Returns posts you’ve bookmarked
in:likes Returns posts you’ve liked
in:posted Returns your posts
in:created Returns first posts of topics you created

Category and Tag Filters

Syntax Description
categories:category1,category2 Returns posts from the categories category1 and category2
#slug Searches by category slug or tag name, depending on context
tags:tag1,tag2,tag3 Returns posts tagged with tag1, tag2, or tag3 (comma = OR)
tags:tag1+tag2+tag3 Returns posts tagged with all of tag1, tag2, and tag3 (plus = AND)
-tags:tag1,tag2,tag3 Returns posts not tagged with tag1, tag2, or tag3
in:tagged Returns posts from topics that have at least one tag
in:untagged Returns posts from topics with no tags

Post and View Count Filters

Syntax Description
posts_count:X Returns posts from topics that have exactly X posts
min_posts:X Returns posts from topics with at least X posts
max_posts:X Returns posts from topics with at most X posts
min_views:X Returns posts from topics with at least X views
max_views:X Returns posts from topics with at most X views

Date Filters

Syntax Description
before:YYYY-MM-DD Returns posts created before the specified date
after:YYYY-MM-DD Returns posts created after the specified date
before:YYYY-MM Returns posts created before the specified month
after:YYYY-MM Returns posts created within and after the specified month
before:YYYY Returns posts created before the specified year
after:YYYY Returns posts created within and after the specified year
before:X Returns posts created more than X days ago (X = 1–999)
after:X Returns posts created within the last X days (X = 1–999)
before:day_of_week Returns posts created before the start of the specified day of the week
after:day_of_week Returns posts created on and after the start of the specified day of the week
before:month_name Returns posts created before the specified month (e.g. before:january or before:jan)
after:month_name Returns posts created within and after the specified month
before:yesterday Returns posts created before yesterday
after:yesterday Returns posts created after yesterday

Status Filters

Syntax Description
status:open Returns posts from topics that are not closed or archived
status:closed Returns posts from closed topics
status:archived Returns posts from archived topics
status:noreplies Returns posts from topics with no replies
status:single_user Returns posts from topics with posts from only one user
status:public Returns posts from topics in public categories

File Type Filters

Syntax Description
filetypes:ext1,ext2,ext3 Returns posts with uploads of ext1, ext2, or ext3 file extensions

Language Filters

Syntax Description
locale:language_code Returns posts written in that language, e.g. locale:en, locale:en_US, locale:en-gb
locale:any Returns posts that have a locale set
locale:none Returns posts without a locale

Order

You can sort your search results using the following order options:

Syntax Description
order:latest Sorts results from newest to oldest
order:oldest Sorts results from oldest to newest
order:latest_topic Sorts results by topic creation date, from newest to oldest
order:oldest_topic Sorts results by topic creation date, from oldest to newest
order:views Sorts results by number of views
order:likes Sorts results by number of likes
order:read (logged in only) Sorts by date you last visited the topic

Aliases

Discourse provides several aliases to make searching easier:

Syntax Equivalent
l order:latest
r order:read
f in:first
t in:title
in:personal in:messages
in:mine in:created
min_post_count: min_posts:
category: categories:
tag: tags:
filetype: filetypes:
# Can be used for both categories and tags, depending on context
user: @
@me @your_own_username

Searching for Exact Words

Discourse uses a technique called Stemming to find related words. While this is often helpful, there may be times when you want to search for an exact word. You can do this by enclosing your word with spaces and double quotes, like so: " term ".

This ensures that it will search only for the word “term” and exclude other related words.

:information_source: Note that because the spaces are considered part of the search term, it will not return “term” if it’s the first or the last word of a post since it won’t be preceded or followed by a space.

Example: Searching for @mentions

Currently, searching for @mentions is not directly supported. However, you can achieve this using the exact word search method:

https://meta.discourse.org/search?q=“%20%40username%20”

:information_source: This works because %20 is how spaces are encoded in URLs and %40 is how the @ symbol is encoded.

This query will look specifically for @username (enclosed in spaces).

Combining Search Options

You can combine multiple search options to create more specific queries. For example:

  • status:open category:support tag:urgent after:2023-01-01 order:latest
    This will search for open support topics tagged as urgent, created after January 1, 2023, and sort the results by the latest post.

  • @jane_doe in:watching min_posts:5 with:images
    This will search for posts by Jane Doe in topics you’re watching, with at least 5 posts, and containing images.

Permissions and Limitations

Some advanced search options may require certain user permissions or may be limited to specific user roles. For example:

  • in:all-pms is only available to administrators, not to regular users or moderators.
  • personal_messages:username is only available to administrators.
  • in:whisper requires whisper access.
  • include:unlisted is only available to Trust Level 4 users and staff.

Always consider your user role and permissions when using advanced search options.

Search Alternative: Topic List Filter

An experimental /filter feature is available that supports many filter types. You can learn more on the official topic: Experimental topics list filter feature

Source Files

For a more technical look at these options, all search filters and parameters can be found in search.rb - look for the advanced_filter methods.

Additional Tips

  1. You can also search for mentions of tags like #bug: https://meta.discourse.org/search?q=“%20%23bug”

  2. Some filters may be added by plugins. For example, the Solved plugin adds:

    • status:solved: Returns posts from solved topics
    • status:unsolved: Returns posts from unsolved topics in categories allowing solved marking
  3. The Topic Voting plugin adds:

    • order:votes: Sort results by number of votes on the topic containing the post
    • min_vote_count:X: Returns posts from topics with at least X votes
  4. The Assign plugin adds:

    • in:assigned: Returns posts from topics assigned to someone
    • in:unassigned: Returns posts from topics not assigned to anyone
    • assigned:username: Returns posts from topics assigned to username
  5. The Poll plugin adds:

    • in:polls: Returns posts containing polls

:bulb: Take some time to experiment with different combinations of filters and options to find the most effective search strategy for your needs.

Last edited by @MarkDoerr 2025-12-10T17:14:08Z

Last checked by @hugh 2024-07-25T01:14:19Z

Check documentPerform check on document:
13 Likes

Since some filters are missing, like in:pinned or in:bookmarks and those which have an alias aren’t explained, I tried to add the missing information. Then the table became quite complex, which is why I tried to separate it into smaller tables. This is something the bot also did here. I’m not sure the explanations are all correct. The descriptions in the topic and the ones in @sam’s conversation with the bot differ. For some, I even asked the bot again and got another result (these are the highlighted ones). Perhaps someone can help to correct the descriptions. I am also not entirely happy with the overall appearance. The table columns all have different widths.


Filters

Search Filters

Syntax Description
topic:topic_id Returns posts in a specific topic
in:title
t
Returns topics with the term in the title
in:first
f
Returns only first posts in topics
in:replies Returns only posts that are replies, excludes topic OPs
in:regular Excludes small action posts, whispers, and posts with staff color applied
in:whispers
in:whisper
:information_source: For users with whisper access only
Returns whisper posts
include:unlisted
include:invisible
:information_source: For Trust Level 4 and staff only
Returns posts, including those from unlisted topics
in:all :information_source: For logged-in users only
Returns posts from public topics and personal messages
in:all-posts Returns every post that matches the query, even when multiple posts match within the same topic
in:pinned Returns pinned posts
in:wiki Returns wiki posts
with:images Returns posts containing images
filetypes:ext1,ext2,ext3
filetype:ext1,ext2,ext3
Returns posts with uploads of ext1, ext2, or ext3 file extensions
badge:name_or_id Returns posts linked to a specific badge grant

Message Filters

(for logged-in users)

Syntax Description
in:personal
in:messages
Returns posts from personal messages
in:personal-direct Returns posts from personal messages between you and exactly one other user
group_messages:group_name_or_id Returns posts from personal messages sent to the group_name group (This does only work when the group and it’s members are visible for you)
personal_messages:username :information_source: For Admins only
Returns posts from personal messages of the specified user
in:all-pms :information_source: For Admins only
Returns posts from all personal messages, including those you’re not a part of

User and Group Specific Filters

Syntax Description
@username
user:username_or_id
Returns posts by username
created:@username
in:first @username
Returns first posts in topics created by username
group:group_name_or_id Returns posts from users within the group_name group
in:bot
in:bots
Returns posts from system and bot accounts (e.g., @system, @discobot)
in:human
in:humans
Returns posts from regular users

Category and Tag Filters

Syntax Description
category:category1
#category1
Returns posts from category1 and its subcategories
category:=category1
#=category1
Returns posts from category1, excluding its subcategories
categories:category1,category2
category:category1,category2
Returns posts from the categories category1 and category2 and their subcategories
categories:=category1,=category2
category:=category1,=category2
Returns posts from the categories category1 and category2, excluding their subcategories.
tag:tag1
#tag1
Returns posts from topics tagged with tag1
-tag:tag1 Returns posts from topics not tagged with tag1
tags:tag1,tag2
tag:tag1,tag2
Returns posts from topics tagged with tag1 or tag2
-tags:tag1,tag2
-tag:tag1,tag2
Returns posts from topics not tagged with tag1 or tag2
tags:tag1+tag2
tag:tag1+tag2
Returns posts from topics tagged with tag1 and tag2
-tags:tag1+tag2
-tag:tag1+tag2
Returns posts from topics not tagged with tag1 and tag2
in:tagged Returns posts from topics that have at least one tag
in:untagged Returns posts from topics with no tags

Personalized Filters (User-Specific)

(for logged-in users)

Syntax Description
in:seen Returns posts you’ve seen
in:unseen Returns posts you haven’t seen
in:watching Returns posts from topics you’re watching
in:tracking Returns posts from topics you’re tracking
in:bookmarks Returns posts you’ve bookmarked
@me
@your_own_username
Returns posts written by you
in:posted Returns all posts of topics you have posted in
in:created
in:mine
Returns first posts of topics written by you

Post and View Count Filters

Syntax Description
min_posts:X
min_post_count:X
Returns posts from topics with at least X posts
max_posts:X Returns posts from topics with at most X posts
posts_count:X Returns posts from topics that have exactly X posts
min_views:X Returns posts from topics with at least X views
max_views:X Returns posts from topics with at most X views

Date Filters

All dates are in UTC, we always use beginning of day UTC as the start time for any period.

Syntax Description
before:YYYY-MM-DD Returns posts created before the specified date
after:YYYY-MM-DD Returns posts created after the specified date
before:day_of_week Returns posts created before the specified day of the week
after:day_of_week Returns posts created on and after the specified day of the week
before:X Returns posts created more than X days ago
after:X Returns posts created within the last X days
before:month Returns posts created before the specified month
after:month Returns posts created within and after the specified month
before:YYYY Returns posts created before the specified year
after:YYYY Returns posts created within and after the specified year

Status Filters

Syntax Description
status:open Returns posts from topics that are not closed or archived
status:closed Returns posts from closed topics
status:archived Returns posts from archived topics
status:noreplies Returns posts from topics with no replies
status:single_user Returns posts from topics with posts from only one user
status:public Returns posts from topics in public categories

Language filters

Syntax Description
locale:language_code Returns posts written in that language e.g. en, en_US, en-gb
locale:any
locale:present
Returns posts that have a locale set
locale:none
locale:null
Returns post without a locale

Filters added by Plugins

Syntax Description
Assign
in:assigned Returns posts from topics assigned to someone
in:unassigned Returns posts from topics not assigned to anyone
assigned:username Returns posts from topics assigned to username
Docs
in:docs
in:kb
Returns posts from categories and tags included in docs
Doc Categories
in:docs Returns posts from categories that have an index topic
Polls
in:polls Returns posts containing polls
Solved
status:solved Returns posts from solved topics
status:unsolved Returns posts from unsolved topics in categories allowing solved marking
Topic voting
min_vote_count:X Returns posts from topics with at least X votes

Order

Syntax Description
order:latest
l
Sorts results from newest to oldest
order:oldest Sorts results from oldest to newest
order:latest_topic Sorts results by topic date, from newest to oldest
order:oldest_topic Sorts results by topic date, from oldest to newest
order:views Sorts results by number of views
order:likes Sorts results by number of likes
order:read
r
:information_source: For logged-in users only
Sorts results by date you last visited the topic

Order options added by Plugins

Syntax Description
Topic voting
order:votes Sort results by number of votes on the topic containing the post
5 Likes

Apologies all, I just did a big round of updates and deleted a bunch of discussion here that has gotten stale, let me know if you notice anything wrong with the above document and I will be happy to add.

It was cross referenced with current source code so should be up to date now.

Would you somehow provide me with the content of the wiki I had below this post? I don’t remember everything I added. I think there is still something missing in the first post, for example, how to search within a category excluding its subcategories.

I can do better Moin, undeleted it for now. Feel free to make a suggested edit to the OP if you feel it needs any more … once done let me know and I will clear this up.

TL3 can now suggest edits … but we have a huge backlog, it may take a while for us to get to them

1 Like