FIX: exact matching should also match on title

This commit is contained in:
Sam
2018-05-08 15:59:03 +10:00
parent c6f45fcfdb
commit 858a266031
2 changed files with 12 additions and 2 deletions

View File

@ -698,7 +698,7 @@ class Search
posts = posts.where("post_search_data.search_data @@ #{ts_query(weight_filter: weights)}")
exact_terms = @term.scan(/"([^"]+)"/).flatten
exact_terms.each do |exact|
posts = posts.where("posts.raw ilike ?", "%#{exact}%")
posts = posts.where("posts.raw ilike :exact OR topics.title ilike :exact", exact: "%#{exact}%")
end
end
end