Merge remote-tracking branch 'parent/main' into upstream-20240531
This commit is contained in:
commit
13ad383039
101 changed files with 1486 additions and 1232 deletions
|
@ -174,13 +174,23 @@ class AccountSearchService < BaseService
|
|||
end
|
||||
|
||||
def call(query, account = nil, options = {})
|
||||
@query = query&.strip&.gsub(/\A@/, '')
|
||||
@limit = options[:limit].to_i
|
||||
@offset = options[:offset].to_i
|
||||
@options = options
|
||||
@account = account
|
||||
MastodonOTELTracer.in_span('AccountSearchService#call') do |span|
|
||||
@query = query&.strip&.gsub(/\A@/, '')
|
||||
@limit = options[:limit].to_i
|
||||
@offset = options[:offset].to_i
|
||||
@options = options
|
||||
@account = account
|
||||
|
||||
search_service_results.compact.uniq
|
||||
span.add_attributes(
|
||||
'search.offset' => @offset,
|
||||
'search.limit' => @limit,
|
||||
'search.backend' => Chewy.enabled? ? 'elasticsearch' : 'database'
|
||||
)
|
||||
|
||||
search_service_results.compact.uniq.tap do |results|
|
||||
span.set_attribute('search.results.count', results.size)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue