|
|
|
@ -65,12 +65,13 @@ module Submitters
|
|
|
|
SearchEntries.build_weights_wildcard_tsquery(keyword, weight)
|
|
|
|
SearchEntries.build_weights_wildcard_tsquery(keyword, weight)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
submitters.where(
|
|
|
|
submitter_ids = SearchEntry.where(record_type: 'Submitter')
|
|
|
|
id: SearchEntry.where(record_type: 'Submitter')
|
|
|
|
.where(account_id: current_user.account_id)
|
|
|
|
.where(account_id: current_user.account_id)
|
|
|
|
.where(*query)
|
|
|
|
.where(*query)
|
|
|
|
.limit(500)
|
|
|
|
.select(:record_id)
|
|
|
|
.pluck(:record_id)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
submitters.where(id: submitter_ids.first(100))
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def plain_search(submitters, keyword)
|
|
|
|
def plain_search(submitters, keyword)
|
|
|
|
|