Change account search to match by text when opted-in (#25599)
Co-authored-by: Eugen Rochko <eugen@zeonfederated.com>
This commit is contained in:
parent
285a691936
commit
4581a528f7
5 changed files with 90 additions and 29 deletions
|
@ -106,6 +106,17 @@ module AccountSearch
|
|||
LIMIT :limit OFFSET :offset
|
||||
SQL
|
||||
|
||||
def searchable_text
|
||||
PlainTextFormatter.new(note, local?).to_s if discoverable?
|
||||
end
|
||||
|
||||
def searchable_properties
|
||||
[].tap do |properties|
|
||||
properties << 'bot' if bot?
|
||||
properties << 'verified' if fields.any?(&:verified?)
|
||||
end
|
||||
end
|
||||
|
||||
class_methods do
|
||||
def search_for(terms, limit: 10, offset: 0)
|
||||
tsquery = generate_query_for_search(terms)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue