On rails 4 using the search Pg.
For a while, I was stuck trying to get exact matches to display in the first place. Well, I finally got it to work in development, but when I turned to the hero, it no longer worked.
Cream cheesewill be displayed before cheese. Coke zerowill be displayed before coke. Etc. Has anyone had this problem? Cannot find the documentation and don’t know where to go from here. It is difficult to diagnose any problems, as this works in development.
This is what my scope is as follows:
pg_search_scope :search, :against => :specific,
:using => { dmetaphone: {}, tsearch: { dictionary: 'english' },
trigram: {:threshold => 0.5} },
ignoring: :accents
source
share