Exclude category from search

AI-generated summary

The discussion revolves around the desire to exclude a category from search results on a Discourse forum. jmamazo initially asks if it’s possible to exclude a category from search, citing that most users don’t use advanced filters and would like to always exclude a specific category.

erlend_sh clarifies the request, and jmamazo confirms they want to completely ignore a category from search results. erlend_sh mentions “Unlisted categories” as a potential solution, but codinghorror notes that unlisted categories would not affect search results.

sam suggests adding a feature to set “search priority” for categories, allowing admins to bump certain categories to the top of search results. jmamazo agrees, but proposes that the unwanted category should be displayed last in search results.

A related issue is raised by SidV, who wants to exclude a sub-category from search results. cpradio responds that this is not currently possible, citing relevant code from the Discourse repository.

Hello guys

Is there a way to exclude a category from “search” I mean forum wide. I know I can use advanced filter but most users just dont bother about checking those and we would like to always exclude a category from search results.

Thanks

1 Like

Do you mean exclude the topics in a specific category from searches?

yes, completely ignoring it :grinning: our dream is much more complicated than that, like (ignore it unless it hast 3 posts for example, but I know thats too much to ask)
Best

The closest thing to this is probably “Unlisted categories”, which is a new feature under consideration.

Unlisted would not affect search though. That should not even be on the table as it significantly complicates things. (category security would affect it anyway, as usual)

I definitely want to add a feature that allows admins to set “search priority” for categories, so, for example: #faq always gets a bump and shows up first.

I think this is a better feature than totally removing results from search, if users are allowed to read the topics, why not allow them to find them @jmamazo ?

5 Likes

I totally agree with you, but then it would be better if category XXX is always last to show, so the most interesting categories are always on top of the search.
Our use-case:
Every time our web-application creates a project a post is created announcing the creation, this allow us to have comments in that project inside our website. Then we have a real forum with way more interesting categories where people are usually active in topics not always related to the projects. and then when you have 1000s of projects then you have a lots of posts that “real forum users” are not interested (95% of time).

Hello, I need to exlude a sub-category from searching.

Example:

status:noreplies category:5

But, category 5, has got two more sub-categories (6 and 7).
How can I search only threads in category 5, and don’t show the others discussions in categories 6 and 7?

I don’t think that is possible yet. From what I can tell, when you specify category:5 or #category5, it will search both that category and any categories that have it as its parent.

Relevant code:

2 Likes