# 如何进行类别：搜索包含多个词的类别？

**URL:** <https://meta.discourse.org/t/how-to-do-a-category-search-for-multi-word-categories/30460>\
**Category:** Support\
**Tags:** search\
**Created:** [2015年六月25日 20:17 UTC](https://meta.discourse.org/t/how-to-do-a-category-search-for-multi-word-categories/30460 "2015-06-25T20:17:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![downey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/downey/32/166878_2.png) [@downey](https://meta.discourse.org/u/downey)\
**Post date:** [2015年六月25日 20:17 UTC](https://meta.discourse.org/t/how-to-do-a-category-search-for-multi-word-categories/30460/1 "2015-06-25T20:17:34Z")

</div>

So I have some categories that have one-word titles, e.g., “Foo”, and also categories that have more than one word, e.g., “Foo Bar”.

The following works for constraining search results to a category:  
`category:Foo` or [https://discourse.example.org/search?q=category%3AFoo](https://discourse.example.org/search?q=category%3AFoo)

The following does not work:  
`category:Foo Bar` or [https://discourse.example.org/search?q=category%3AFoo%20Bar](https://discourse.example.org/search?q=category%3AFoo%20Bar)

Meta repro:  
`category:discourse hub` or [Search results for 'category:discourse hub' - Discourse Meta](https://meta.discourse.org/search?q=category%3Adiscourse%20hub)

* * *

I was doing this because I wanted to put a hyperlink to such a query to show the unsolved topics in my support category, but can’t because that category has multiple words. 🙂

---

<div class="post-metadata">

**Author:** ![Er00](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/er00/32/42921_2.png) [@Er00](https://meta.discourse.org/u/Er00)\
**Post date:** [2015年六月30日 17:14 UTC](https://meta.discourse.org/t/how-to-do-a-category-search-for-multi-word-categories/30460/2 "2015-06-30T17:14:18Z")

</div>

You need to use underscores:  
`category:discourse_hub` or `https://meta.discourse.org/search?q=category%3Adiscourse_hub`

I don’t know why it doesn’t use the hyphens that the categories use in URL view, but I tried underscores because that’s what some other things use in Discourse and it worked. 🙂

---

<div class="post-metadata">

**Author:** ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)\
**Post date:** [2024年六月8日 12:46 UTC](https://meta.discourse.org/t/how-to-do-a-category-search-for-multi-word-categories/30460/3 "2024-06-08T12:46:07Z")

</div>

此主题已在 3270 天后自动关闭。不允许回复。
