Search Improvements in 2.3

For the upcoming 2.3 release, we’ve added a new feature and made several fixes to the way we index posts for search that will make search results better.

1. Search Priorities for Categories


Each individual category can be configured with a search priority which you can find under the Settings tab when creating/editing a category. Five levels for prioritization have been added: ignore, very low, low, high and very high. The levels work by multiplying a pre-configured weight to the search ranking for each result and can be configured via hidden site settings in your console.

As an example, configuring a category’s search priority to very_high will boost its search ranking by 40% while a search priority of very_low will reduce its search ranking by 40%. Setting a category’s search priority to ignore will remove it from the search results. However, you can still search for posts within the ignored category by scoping the search to the category via advanced search. Do take note that search priority is not inherited which means that a sub-category will still be searchable even if the parent category has been configured to be ignored.

2. Improvements and Fixes to Search Results

  1. Search relevance has been updated to consider the document length in the ranking. Previously, search ranking was ranked by the most number of matches for the given search term. This was problematic for search results as we noticed that longer posts were more likely to be ranked higher because of the tendency to produce a higher number of matches. As a result, we’ve made the switch to consider the document length when ranking search results.
    FIX: Relevance search will now consider document length in ranking. · discourse/discourse@e87ca59 · GitHub

  2. Improve the quality of the raw data that we use to generate the search index. PERF: Improve quality of `PostSearchData#raw_data`. (#7275) · discourse/discourse@cfd5078 · GitHub

    • URLs in posts were sometimes incorrectly tokenized and indexed twice leading to terms within links having a higher ranking.
    • Content for lightboxes in posts were polluting search results with the image’s metadata.
  3. Empty posts such as moderator actions or small post actions (closing, assigning) are no longer part of the search index. This change leads to a smaller index and less noise in search results. FIX: Don't index posts with empty `Post#raw` for search. (#7263) · discourse/discourse@daeda80 · GitHub

  4. Smaller search index by deleting posts of trashed topics from the index. PERF: Delete search data of posts from trashed topics periodically. (… · discourse/discourse@d151425 · GitHub

  5. When a post is moved to a different topic, the search data for the post was not updated and would lead to the post incorrectly appearing in searches that matched the category of the old topic. FIX: Reindex post for search when post is moved to a different topic. · discourse/discourse@d808f36 · GitHub

  6. Smaller payload for search results by excluding the cooked version of the posts. PERF: Reduce number of queries and size of payload when searching. · discourse/discourse@03c6b22 · GitHub

  7. The blurb for posts in search results was broken when searching for an exact phrase and lead to missing search term highlights on the client side. FIX: Post blurb incorrect when search contains a phrase match. · discourse/discourse@dae0bb4 · GitHub

Do let us know if you’re search results have improved after these changes. We would also like to know if you think your search results have become worse so that we can continue to refine it. Thank you all!

43개의 좋아요

Is the age of a post part of the weight in ranking search results? Information gets stale fairly quickly in our forum, so it would be nice to have a way to reduce the relevance of older postings without actually eliminating them.

11개의 좋아요

Not yet, but it is an interesting idea, even in the weaker form of simply factoring in the date the topic was last touched

7개의 좋아요

검색 결과에서 특정 주제를 "고정"할 수 있는 기능이 있으면 좋겠습니다. 이렇게 하면 자주 검색되는 항목들이 바로 저희 튜토리얼로 연결될 수 있습니다.

해당 토픽이 포함된 카테고리의 검색 우선순위를 변경하여 이 작업을 수행합니다.

제 '문제’는 해당 주제들이 맥락에 따라 모든 포럼 카테고리에 흩어져 있다는 점입니다. 따라서 카테고리 기반 접근법을 사용할 수 없습니다.

그러면 당신은 막혀버리는 겁니다. 주제별로 무작위로 이 작업을 수행하는 방법은 없으며, 앞으로도 없을 것이기 때문입니다.

나중에 태그에 대한 검색 우선순위 설정 기능이 추가될 수도 있겠네요? 다만, 하나의 주제에 여러 태그가 붙을 수 있어서 그렇게 단순하지는 않을 것 같습니다.

어쨌든 카테고리 가중치 설정은 훌륭한 기능입니다! 제 포럼에는 검색 결과에서 좀 더 아래로 밀어내면 좋을 스팸성 특수 용도 카테고리가 몇 개 있어서요.

6개의 좋아요

네, 언젠가 그런 일이 일어날 것 같습니다.

10개의 좋아요

그렇게 되면 정말 멋질 거예요! 그러면 블로그 게시물을 그런 식으로 태그를 붙이고 검색 시 우선순위를 줄 수 있거든요…

1개의 좋아요

특정 태그가 검색 우선순위에도 영향을 미칠 수 있는 방법을 보고 싶습니다.

4개의 좋아요

2.4.X나 2.5에 이 기능이 추가될 계획이 있나요?

이제 이런 것도 있나요?

이 자료를 해석할 만큼 능숙하지 않습니다: Search Controller Need help with understanding how discourse search works - #3 by neounix

2개의 좋아요

아직 아닙니다. 현재는 카테고리만 검색 우선순위를 설정할 수 있습니다.

3개의 좋아요