# Search doesn't work properly with a specific word

**URL:** https://meta.discourse.org/t/search-doesnt-work-properly-with-a-specific-word/51195
**Category:** Bug
**Created:** [October 6, 2016, 10:00pm UTC](https://meta.discourse.org/t/search-doesnt-work-properly-with-a-specific-word/51195 "2016-10-06T22:00:32Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![dax](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dax/32/244677_2.png) [@dax](https://meta.discourse.org/u/dax)
#### Post date: [October 6, 2016, 10:00pm UTC](https://meta.discourse.org/t/search-doesnt-work-properly-with-a-specific-word/51195/1 "2016-10-06T22:00:33Z")

</div>

Today (and few days ago) I tried to search here on Meta the word “`canned`” (for canned replies plugin) but the results is always ` No results found.`  
Same results searching “`Canned`” or even “`canned replies`”.

[https://global.discourse-cdn.com/meta/original/3X/0/9/09104055d65eff6bf1190b4eb825c9a470e0656a.mp4](https://global.discourse-cdn.com/meta/original/3X/0/9/09104055d65eff6bf1190b4eb825c9a470e0656a.mp4)

This is driving me crazy because on my forum (v1.7.0.beta5 +45) it works:

[https://global.discourse-cdn.com/meta/original/3X/d/b/db317a1e65bd0a80f3451e55d55227c5f93cf107.mp4](https://global.discourse-cdn.com/meta/original/3X/d/b/db317a1e65bd0a80f3451e55d55227c5f93cf107.mp4)

Meta doesn’t ❤ this word, why?

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [October 6, 2016, 10:54pm UTC](https://meta.discourse.org/t/search-doesnt-work-properly-with-a-specific-word/51195/2 "2016-10-06T22:54:48Z")

</div>

> [@Trash](#):
>
> Meta doesn’t ❤ this word, why?

Maybe because the topic started off in “uncategorized”?

EDIT

Looks like something is wrong, Google finds plenty

> **[Google Search](https://www.google.com/search?q=site%3Ameta.discourse.org%20canned)**

---

<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: [October 6, 2016, 11:06pm UTC](https://meta.discourse.org/t/search-doesnt-work-properly-with-a-specific-word/51195/3 "2016-10-06T23:06:32Z")

</div>

Looks like the search term was `canned`.

Thank you all, I will walk myself out.

will have a look, this is odd

---

<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: [October 6, 2016, 11:36pm UTC](https://meta.discourse.org/t/search-doesnt-work-properly-with-a-specific-word/51195/4 "2016-10-06T23:36:33Z")

</div>

OK, this is what is happening… “canned” is being stemmed to “can” and indexed as “can”, later on we perform a `TO_TSQUERY` on the stemmed word “can” instead of “canned” and … `can` happens to be a stopword so it gets zero results.

The fix is to stop stemming the search term, will sort it out.

---

<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: [October 7, 2016, 12:35am UTC](https://meta.discourse.org/t/search-doesnt-work-properly-with-a-specific-word/51195/5 "2016-10-07T00:35:20Z")

</div>

> [@sam](#):
>
> “canned” is being stemmed to “can”

This is not even _correct_

---

<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: [October 7, 2016, 12:45am UTC](https://meta.discourse.org/t/search-doesnt-work-properly-with-a-specific-word/51195/6 "2016-10-07T00:45:35Z")

</div>

Welcome to snowball

> **[Demo - Snowball](https://snowballstem.org/demo.html)**

---

<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: [October 7, 2016, 3:59am UTC](https://meta.discourse.org/t/search-doesnt-work-properly-with-a-specific-word/51195/7 "2016-10-07T03:59:33Z")

</div>

I fixed this here:

[https://github.com/discourse/discourse/commit/647ee46edff789634a34dc0a406d19d8a50f21cd](https://github.com/discourse/discourse/commit/647ee46edff789634a34dc0a406d19d8a50f21cd)

Longer term it may make sense to shift all the stemming into ruby and use a simple fulltext index.

---

<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: [October 7, 2016, 3:59am UTC](https://meta.discourse.org/t/search-doesnt-work-properly-with-a-specific-word/51195/8 "2016-10-07T03:59:35Z")

</div>


