fix: update in the text search query with includes
This commit is contained in:
parent
4f651d04ee
commit
c842c98769
1 changed files with 6 additions and 3 deletions
|
@ -20,16 +20,19 @@ class TextSearch
|
|||
|
||||
def filter_conversations
|
||||
@conversations = PgSearch.multisearch((@params[:q]).to_s).where(account_id: @current_account, searchable_type: 'Conversation').joins(
|
||||
"INNER JOIN conversations ON pg_search_documents.searchable_id = conversations.id").includes(:searchable).limit(20).collect(&:searchable)
|
||||
'INNER JOIN conversations ON pg_search_documents.searchable_id = conversations.id'
|
||||
).includes(:searchable).limit(20).collect(&:searchable)
|
||||
end
|
||||
|
||||
def filter_messages
|
||||
@messages = PgSearch.multisearch((@params[:q]).to_s).where(account_id: @current_account, searchable_type: 'Message').joins(
|
||||
"INNER JOIN messages ON pg_search_documents.searchable_id = messages.id").includes(:searchable).limit(20).collect(&:searchable)
|
||||
'INNER JOIN messages ON pg_search_documents.searchable_id = messages.id'
|
||||
).includes(:searchable).limit(20).collect(&:searchable)
|
||||
end
|
||||
|
||||
def filter_contacts
|
||||
@contacts = PgSearch.multisearch((@params[:q]).to_s).where(account_id: @current_account, searchable_type: 'Contact').joins(
|
||||
"INNER JOIN contacts ON pg_search_documents.searchable_id = contacts.id").includes(:searchable).limit(20).collect(&:searchable)
|
||||
'INNER JOIN contacts ON pg_search_documents.searchable_id = contacts.id'
|
||||
).includes(:searchable).limit(20).collect(&:searchable)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue