mirror of
https://github.com/discourse/discourse.git
synced 2025-06-02 04:08:41 +08:00
FEATURE: Roll out new search optimisations (#20364)
- Reduce duplication of terms in post index from unlimited to 6. This will result in reduced index size and reduced weighting for posts containing a huge amount of duplicate terms. (Eg: a post containing "sam sam sam sam sam sam sam sam", will index as "sam sam sam sam sam sam", only including the word up to 6 times.) This corrects a flaw where title weighting could be ignored. - Prioritize exact matches of words in titles. Our search always performs a prefix match. However we want to give special weight to exact title matches meaning that a search for "sum" will find topics such as "the sum of us" vs "summer in spring". - Pick up fixes to our search algorithm which are missing from old indexes. Specifically pick up the fix that indexes URLs properly. (`https://happy.com` was stemmed to `happi` in keywords and then was not searchable) see also: https://meta.discourse.org/t/refinements-to-search-being-tested-on-meta/254158 Indexing will take a while and work in batches, in the background.
This commit is contained in:
@ -122,6 +122,8 @@ RSpec.describe Search do
|
||||
|
||||
before do
|
||||
SearchIndexer.enable
|
||||
SiteSetting.max_duplicate_search_index_terms = -1
|
||||
SiteSetting.prioritize_exact_search_title_match = false
|
||||
[post1, post2].each { |post| SearchIndexer.index(post, force: true) }
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user