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
|
@ -481,7 +481,7 @@ class Search
|
||||||
if @term.present?
|
if @term.present?
|
||||||
if is_topic_search
|
if is_topic_search
|
||||||
posts = posts.joins('JOIN users u ON u.id = posts.user_id')
|
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
|
else
|
||||||
posts = posts.where("post_search_data.search_data @@ #{ts_query}")
|
posts = posts.where("post_search_data.search_data @@ #{ts_query}")
|
||||||
exact_terms = @term.scan(/"([^"]+)"/).flatten
|
exact_terms = @term.scan(/"([^"]+)"/).flatten
|
||||||
|
|
Loading…
Reference in New Issue