mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -05:00
FEATURE: add name and username to search within topic
This commit is contained in:
parent
68e56db61c
commit
05eff38f34
1 changed files with 2 additions and 1 deletions
|
@ -255,7 +255,8 @@ class Search
|
|||
.where("topics.archetype <> ?", Archetype.private_message)
|
||||
|
||||
if @search_context.present? && @search_context.is_a?(Topic)
|
||||
posts = posts.where("posts.raw ilike ?", "%#{@term}%")
|
||||
posts = posts.joins('JOIN users u ON u.id = posts.user_id')
|
||||
posts = posts.where("posts.raw || ' ' || u.username || ' ' || u.name ilike ?", "%#{@term}%")
|
||||
else
|
||||
posts = posts.where("post_search_data.search_data @@ #{ts_query}")
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue