Change account search to match by text when opted-in (#25599)

Co-authored-by: Eugen Rochko <eugen@zeonfederated.com>
This commit is contained in:
jsgoldsteinandEugen Rochko authored and GitHub committed 2023-06-29 13:05:21 +02:00
1 parent 285a691936
commit 4581a528f7
5 files changed
+90 -29

No files matched your search

+11
View File
@@ -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)