如何使用续集ORM和3个参数进行full_text_search?

时间:2015-02-16 14:25:16

标签: ruby postgresql sequel

这是杰里米!这可能是不可能的,因为我想将3个参数传递给全文搜索,但它只设计为一个。这是代码:

experience_search_term = params[:search_term] 
candidates.full_text_search(:experience, experience_search_term).to_a.to_json

工作正常,但

candidates.where(:city => params['city'], :industry => params['industry']).full_text_search(:experience  => params['search_term']).to_a.to_json

不会也不会破解:

dataset = candidates.where(:city => params['city'], :industry => params['industry'])
dataset.full_text_search(:experience  => params['search_term']).to_a.to_json

有办法做到这一点吗?感谢所有的帮助。

1 个答案:

答案 0 :(得分:0)

我认为您想要使用2个参数而不是单个哈希,就像在第一个示例中一样:

dataset = candidates.where(:city => params['city'], :industry => params['industry'])
dataset.full_text_search(:experience, params['search_term']).to_a.to_json