Search function improvement

AI-generated summary

The discussion is about improving the search function in Discourse. nujabes wants to limit search results to only titles and is frustrated that articles with the search term in the main text are appearing at the top. Dannii suggests adding in:title to the search terms to achieve this. However, nujabes is still not satisfied with the sorting of search results, wanting more exact matches to appear at the top. Dannii explains that Discourse’s search algorithm is limited compared to Google’s and can’t distinguish between different uses of a word or ignore idioms. They suggest using the “Most Viewed” sorting as a possible solution. nujabes thanks Dannii for the explanation and now understands how Discourse controls the order of search results.

When users search “bear” in a search function, I suppose that “bear” in the title used to be on the top in search results.
However, now article that includes many “bear” not in the title but in main text is on the top.

I want to let the search function retrieve only from the title.

How can I achieve this?

Add in:title to your search terms to limit searches only to topic titles.

Thanks. But the order of search results is not what I expected.
Do you know the condition of sorting the search results?

I don’t know what you’re expecting the sort order to be, but you can change it with the drop down.

OK, let me explain how I use my discourse.

When I search “discourse” on google for example, “discourse” should be on the top.
“discourse meta ABC” should not be on the top since I just enter “discourse.”

Now I use my discourse as a dictionary. When my user searches “bear”, the search result of “bear” is on the bottom somehow.
Instead, idioms such as “bear up”, “bear the brunt of” and “bar out” are on the top rather than “bear.”

That’s why I want to know how discourse manages the sorting of search results.

Nothing inherently makes the Discourse frontpage more relevant that something else. Google can do what it does because it considers all the links on the whole internet. Discourse isn’t building a map of the internet, but doing text search. It can’t know the difference between all the uses of the word “bear”. It can’t ignore idioms. And when you limit searches to only titles, then it has a lot less to go on - it can determine “relevance” based on the number of times the search terms come up in a whole post, but when you limit it to titles then lots of titles will only have the search term once, and so will be ranked equally.

That said, the “Most Viewed” sorting might help.

OK, now I understand how Discourse controls the order of search results.
Thanks for your explanation!