28efe28f24
Lean on ActiveRecord models for searching and strip out the raw SQL. Replaces the search_index_* tables with sharded search_records_* tables as that allows us to use a Search::Record model name. A Class is dynamically created for each record table shard so that we and we can access it via the Search::Record.for_account(account_id) method.
10 lines
193 B
Ruby
10 lines
193 B
Ruby
module Search
|
|
def self.table_name_prefix
|
|
"search_"
|
|
end
|
|
|
|
def self.results(query:, user:)
|
|
Record.for_account(user.account_id).search(query: Query.wrap(query), user: user)
|
|
end
|
|
end
|