搜索是否应限制在类别内,并包含子类别?

我有一个用于挑战/任务的分类,除了其子分类外,该分类本身是空的。我原以为搜索该分类就能找到子分类中的内容,但实际却不行。

在这里的 meta 页面上,点击 Customization > Plugin 并搜索 “discord”,你可以找到 “Discourse to Discord bot” 这篇帖子;但如果直接搜索该插件分类,这条帖子就找不到了。如果能在所有这些分类中一起搜索就好了。

7 个赞

Hmm yeh, haven’t really encountered this before but I think searching category+sub-categories by default makes sense. We’d have to come up with some sort of syntax for when you only want to search the parent category though, like category:plugin+none

2 个赞

This is now supported as per this change by @sam

https://github.com/discourse/discourse/commit/df8f365d999e113615c51efee4cfa3115c267783

So:

To search howto and all sub categories use

something howto

OR

something category:howto

To restrict it so you only search the category howto without children use:

something #=howto

OR

something category:=howto


We still need to decide what to do about the “search this category” checkbox.

6 个赞

Is there room for two check boxes?

When is two checkboxes ever the right choice?

5 个赞

Sounds compelling. In that case, I vote for the check box to include subcategories.

1 个赞

You mean to exclude? As it is included by default now…

1 个赞

I think he means this :slight_smile:

I also think include by default is probably a better call

“Search the howto category” may need slightly better wording though.

7 个赞