# Advanced search for a subcategory

**URL:** <https://meta.discourse.org/t/advanced-search-for-a-subcategory/87060>\
**Category:** Product Support\
**Created:** [May 9, 2018, 12:21pm UTC](https://meta.discourse.org/t/advanced-search-for-a-subcategory/87060 "2018-05-09T12:21:45Z")\
**Posts on this page:** 6\
**Page:** 1

## AI-generated summary

In a discussion about advanced search for subcategories, [Francois_Douville](/t/-/87060/1) reported an issue where searching within a specific subcategory returned results from outside that subcategory, noting that five of six results were correct but one was not. [codinghorror](/t/-/87060/2) asked if [jomaxro](/t/-/87060/4) could reproduce the bug. [jomaxro](/t/-/87060/4) initially stated they could not reproduce the issue on Meta, observing that keyword searches in subcategories yielded correct results there. [sam](/t/-/87060/5) hypothesized that the problem might be caused by special characters (specifically `ê`) in the category name being stripped from the slug, potentially causing a collision or routing error. Although [sam](/t/-/87060/5) had their reply marked as the solution, [jomaxro](/t/-/87060/7) performed a test on the `try` site by creating a subcategory named `Gêneral`, which automatically generated the slug `general`. Despite an existing category named `General` sharing the same slug, the search function worked as expected, returning no topics from the other category, suggesting the issue may be environment-specific or related to the original data structure rather than the slug generation logic itself.

<div class="post-metadata">

**Author:** ![Francois\_Douville](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/francois_douville/32/94221_2.png) [@Francois\_Douville](https://meta.discourse.org/u/Francois_Douville)\
**Post date:** [May 9, 2018, 12:21pm UTC](https://meta.discourse.org/t/advanced-search-for-a-subcategory/87060/1 "2018-05-09T12:21:45Z")

</div>

I specify a subcategory in my research

 ![29](https://global.discourse-cdn.com/meta/original/3X/e/4/e4dc4cbbe6c7b96d83907da9adbe68a238c3e10b.png)

I had six results. Five were good, but the last one was not in this subcategory.

![33](https://global.discourse-cdn.com/meta/original/3X/7/d/7d8b9e32d4d36380607a0a504cc7ec88c62b6bca.png)

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [May 9, 2018, 10:54pm UTC](https://meta.discourse.org/t/advanced-search-for-a-subcategory/87060/2 "2018-05-09T22:54:34Z")

</div>

Can you repro this @jomaxro?

---

<div class="post-metadata">

**Author:** ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)\
**Post date:** [May 10, 2018, 7:36pm UTC](https://meta.discourse.org/t/advanced-search-for-a-subcategory/87060/4 "2018-05-10T19:36:39Z")

</div>

No, I cannot reproduce this here on Meta. Searching for a keyword in a subcategory provides the correct results.

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [May 13, 2018, 11:34pm UTC](https://meta.discourse.org/t/advanced-search-for-a-subcategory/87060/5 "2018-05-13T23:34:16Z")

</div>

Can you try on try with a category hatted ê in it, my guess is that this is stripped from the slug or something and then causing this site effect.

---

<div class="post-metadata">

**Author:** ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)\
**Post date:** [May 14, 2018, 7:40pm UTC](https://meta.discourse.org/t/advanced-search-for-a-subcategory/87060/7 "2018-05-14T19:40:09Z")

</div>

I see that someone marked your reply as the solution @sam, but I tested this regardless.

I create a new subcategory on try with the category name `Gêneral`. The category slug was automatically generated to be `general`. Try already has a category named `General`, with a slug of `general`. Both categories have 3 topics in them.

Search still works as expected (no topics from other categories):

 ![image](https://global.discourse-cdn.com/meta/original/3X/1/8/18488820572eed0264a2965084e67cf19368ca0f.png)

---

<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:** [June 8, 2024, 12:37pm UTC](https://meta.discourse.org/t/advanced-search-for-a-subcategory/87060/8 "2024-06-08T12:37:27Z")

</div>

Closed on June 8, 2024, 12:37pm UTC

This topic was automatically closed after 2222 days. New replies are no longer allowed.
