Some flaky experience when searching

For example search it, it:, “it, it:”, “it, it:”,, "it, it:", or it, it:”. It does not bring up this post although it does have “it, it:”, in it.[1]

Also, when you press the search button, quotes “” get transformed to "". I don’t like this experience, don’t know if it’s a bug.

Platform: Edge on Android, try.discourse.org, can reproduce with safe mode


  1. In case it becomes auto-deleted: test post content is: It, “it, it:”, it, oandnxkwbs. ↩︎

I think it is a stop word that is excluded from search. Have you tried to reproduce with a word that is not on that list to verify that this is about punctation?
Are specific terms ignored from searches? - #5 by codinghorror

I can’t reproduce it anymore in other form. Maybe the forum I saw the problem on has outdated Discourse.

Actually I think I can reproduce again, try finding this post by searching we don't

And searching “just-use-interface{}/object; we don’t need generics” or "just-use- interface{} / object ; we don't need generics" can’t find it

But searching just-use- interface{} / object ; we don't need generics can find it

Yes, this is correct… you can’t search for it at all… if you try it here you get no results. Words that are likely to appear an extreme number of times (I, the, a, pronouns, etc) are excluded from indexing because they appear too often to provide meaningful differentiation.

same here, we and don't (technically don and t) are not indexed

this situation is a little different… for:

"just-use- interface{} / object ; we don't need generics"

that will never work, the quotes request an exact match and the spaces make it not an exact match

in the case of searching for:

"just-use-interface{}/object; we don't need generics"

the original post text contains a fancy quote (don’t) but search strips those out, so you can’t ever return an exact match for one… this means posts and search aren’t exactly symmetrical which is maybe something that could be improved

this is because without the quotes around it, you’re not searching for an exact match so it picks up the terms “interface” “object” “need” “generics” and that post is the best match for those terms

I found it very difficult to find the topics I was searching for, even with trivial words. It is something named before, and there was a Typesense integration experiment years ago.

I wonder if there are actual plans to improve the Discourse search function? It is one of the most featured tools, and I think it needs some refactoring and love.

Maybe add a “plain text search” option? which disables gotchas like "" quotes

And I’m curious is there a technical reason to exclude we, don’t (don, t) from being indexed for search? Because they’re too common?

yeah exactly

Stop words are words that are very common, appear in almost every document, and have no discrimination value. Therefore, they can be ignored in the context of full text searching. For example, every English text contains words like a and the, so it is useless to store them in an index.

PostgreSQL: Documentation: 18: 12.6. Dictionaries