I'm using the pg_search gem for Rails (Ruby 2.1.1, Rails 4.1.4) and trying to implement a global multisearch for some of my models but I keep getting
PG::UndefinedFunction: ERROR: operator does not exist: text % unknown
when I run the multisearch command.
Here are my models:
# name :text
class Animal < ActiveRecord::Base
has_one :expression
multisearchable against: :name
end
# type :text
class Expression < ActiveRecord::Base
belongs_to :animal
multisearchable against: :type
end
My search query is then something like Happy Tiger
When I run PgSearch.multisearch("Happy Tiger")
though, I get that above error.
I also have an initializer that tells PgSearch to use trigram
Any ideas???