mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Cooked snippet of raw in Topic.similar_to.
If we don't cook the raw, we end up trying to match uncooked raw against `TopicSearchData#search_data` which consists of cooked raw.
This commit is contained in:
@@ -587,8 +587,12 @@ class Topic < ActiveRecord::Base
|
||||
)
|
||||
|
||||
if raw.present?
|
||||
cooked = SearchIndexer::HtmlScrubber.scrub(
|
||||
PrettyText.cook(raw[0...MAX_SIMILAR_BODY_LENGTH].strip)
|
||||
)
|
||||
|
||||
raw_tsquery = Search.set_tsquery_weight_filter(
|
||||
Search.prepare_data(raw[0...MAX_SIMILAR_BODY_LENGTH].strip),
|
||||
Search.prepare_data(cooked),
|
||||
'B'
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user