I'm adding pg_search into a Rails app. I'm following the instructions on github and this railscast, but I've run into a problem.
I'm setting up a multi model search, and I have a basic implementation working. But I want to extend pg_seach to use its English dictionary.
I already have an initializer:
PgSearch.multisearch_options = {
:using => [:tsearch,:trigram],
:ignoring => :accents
}
So, from what I've read, it looks like adding the dictioary should be as simple as
PgSearch.multisearch_options = {
:using => [:tsearch => [:dictionary => "english"],:trigram],
:ignoring => :accents
}
But when I start my server
...config/initializers/pg_search.rb:2: syntax error, unexpected ']', expecting tASSOC (SyntaxError)
:using => [:tsearch => [:dictionary => "english"],:trigram],
I've tried swapping square for curly brackets, and all the other syntax permutations I can think of, but no luck.
What is the correct syntax here? And why aren't my attempts valid, as I've followed the syntax for scoped searches?
:trigram
. Anyway, it's now working, thanks for helping me track this down! – Affra