Change searching with # to include account index (#25638)
This commit is contained in:
@ -133,8 +133,12 @@ class AccountSearchService < BaseService
|
||||
end
|
||||
|
||||
def must_clause
|
||||
fields = %w(username username.* display_name display_name.*)
|
||||
fields << 'text' << 'text.*' if options[:use_searchable_text]
|
||||
if options[:start_with_hashtag]
|
||||
fields = %w(text text.*)
|
||||
else
|
||||
fields = %w(username username.* display_name display_name.*)
|
||||
fields << 'text' << 'text.*' if options[:use_searchable_text]
|
||||
end
|
||||
|
||||
[
|
||||
{
|
||||
|
@ -33,7 +33,8 @@ class SearchService < BaseService
|
||||
resolve: @resolve,
|
||||
offset: @offset,
|
||||
use_searchable_text: true,
|
||||
following: @following
|
||||
following: @following,
|
||||
start_with_hashtag: @query.start_with?('#')
|
||||
)
|
||||
end
|
||||
|
||||
@ -91,11 +92,11 @@ class SearchService < BaseService
|
||||
def full_text_searchable?
|
||||
return false unless Chewy.enabled?
|
||||
|
||||
statuses_search? && !@account.nil? && !((@query.start_with?('#') || @query.include?('@')) && !@query.include?(' '))
|
||||
statuses_search? && !@account.nil? && !(@query.include?('@') && !@query.include?(' '))
|
||||
end
|
||||
|
||||
def account_searchable?
|
||||
account_search? && !(@query.start_with?('#') || (@query.include?('@') && @query.include?(' ')))
|
||||
account_search? && !(@query.include?('@') && @query.include?(' '))
|
||||
end
|
||||
|
||||
def hashtag_searchable?
|
||||
|
Reference in New Issue
Block a user