我正在将pg_search添加到Rails应用程序中.我正在按照github上的说明和这个railscast,但我遇到了一个问题.
我正在建立一个多模型搜索,我有一个基本的实现工作.但是我想扩展pg_seach来使用它的英文字典.
我已经有了一个初始化程序:
PgSearch.multisearch_options = {
:using => [:tsearch,:trigram],
:ignoring => :accents
}
Run Code Online (Sandbox Code Playgroud)
所以,从我读过的内容来看,添加词典就像是一样简单
PgSearch.multisearch_options = {
:using => [:tsearch => [:dictionary => "english"],:trigram],
:ignoring => :accents
}
Run Code Online (Sandbox Code Playgroud)
但是,当我启动我的服务器
...config/initializers/pg_search.rb:2: syntax error, unexpected ']', expecting tASSOC (SyntaxError)
:using => [:tsearch => [:dictionary => "english"],:trigram],
Run Code Online (Sandbox Code Playgroud)
我已经尝试交换方括号和大括号,以及我能想到的所有其他语法排列,但没有运气.
这里的语法是什么?为什么我的尝试没有效果,因为我遵循了范围搜索的语法?