diff --git a/app/models/concerns/nostr/nip50.rb b/app/models/concerns/nostr/nip50.rb index cd7a489..e84dec7 100644 --- a/app/models/concerns/nostr/nip50.rb +++ b/app/models/concerns/nostr/nip50.rb @@ -27,7 +27,7 @@ def self.by_search_query(query) end end - joins(:searchable_content).where("searchable_contents.tsv_content @@ #{ts_function}(?)", text) + where(events: { id: SearchableContent.select(:event_id).where("tsv_content @@ #{ts_function}(?)", text).order(tsv_content: :desc) }) end def matches_full_text_search?(query)