mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-02-17 04:01:29 -05:00
Permit in topic search when full name is null (#4217)
* Permit in topic search when full name is null * as per @gschlager and @ZogStriP pull 4217
This commit is contained in:
parent
d224966a0e
commit
66fb02acad
1 changed files with 1 additions and 1 deletions
|
@ -481,7 +481,7 @@ class Search
|
|||
if @term.present?
|
||||
if is_topic_search
|
||||
posts = posts.joins('JOIN users u ON u.id = posts.user_id')
|
||||
posts = posts.where("posts.raw || ' ' || u.username || ' ' || u.name ilike ?", "%#{@term}%")
|
||||
posts = posts.where("posts.raw || ' ' || u.username || ' ' || COALESCE(u.name, '') ilike ?", "%#{@term}%")
|
||||
else
|
||||
posts = posts.where("post_search_data.search_data @@ #{ts_query}")
|
||||
exact_terms = @term.scan(/"([^"]+)"/).flatten
|
||||
|
|
Loading…
Reference in a new issue