Skip to content

Commit

Permalink
Force Postgres use tsv_content gin index correctly including when LIM…
Browse files Browse the repository at this point in the history
…IT 1 specified
  • Loading branch information
viktorvsk committed Nov 5, 2023
1 parent a035a7d commit 8a7fa0b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/concerns/nostr/nip50.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8a7fa0b

Please sign in to comment.