Search doesn't work properly with a specific word

AI-generated summary

Search Issue with “Canned”

The discussion revolves around a search issue on Meta with the word “canned.” dax reported that searching for “canned,” “Canned,” or “canned replies” yields no results, despite it working on their own forum. Mittineague suggested it might be related to the topic starting in “uncategorized,” but dax found that Google does return results for the search term.

sam initially found the issue odd, but later discovered that the search term “canned” is being stemmed to “can,” which is a stopword, resulting in zero results. codinghorror questioned the correctness of stemming “canned” to “can,” and sam explained that it is due to the Snowball stemming algorithm.

sam has since fixed the issue by committing a change to the Discourse GitHub repository. In the long term, it may be beneficial to shift stemming into Ruby and use a simple full-text index.

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”.

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

Meta doesn’t :heart: this word, why?

2개의 좋아요

Maybe because the topic started off in “uncategorized”?

EDIT

Looks like something is wrong, Google finds plenty

1개의 좋아요

Looks like the search term was canned.

Thank you all, I will walk myself out.

will have a look, this is odd

6개의 좋아요

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.

7개의 좋아요

This is not even correct

Welcome to snowball

1개의 좋아요

I fixed this here:

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.

4개의 좋아요