[Misc] Switch back to using plainto_tsquery

`websearch_to_tsquery` has special meaning for a leading `-`, among other things.
Queries like that always time out, so there's.
This commit is contained in:
Earlopain 2023-03-14 18:58:17 +01:00
parent 35e9ea85c8
commit d4389b756d
No known key found for this signature in database
GPG Key ID: 6CFB948E15246897

View File

@ -104,7 +104,7 @@ class ApplicationRecord < ActiveRecord::Base
if value =~ /\*/
where("lower(#{qualified_column}) LIKE :value ESCAPE E'\\\\'", value: value.downcase.to_escaped_for_sql_like)
else
where("to_tsvector(:ts_config, #{qualified_column}) @@ websearch_to_tsquery(:ts_config, :value)", ts_config: "english", value: value)
where("to_tsvector(:ts_config, #{qualified_column}) @@ plainto_tsquery(:ts_config, :value)", ts_config: "english", value: value)
end
end