我如何使用 sequel ORM 和 3 个参数来执行 full_text_search?
how can I do a full_text_search, using sequel ORM, with 3 parameters?
这是给杰里米的!这可能是不可能的,因为我想将 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
有办法吗?非常感谢所有帮助。
我认为您想使用 2 个参数而不是单个散列,就像您的第一个示例一样:
dataset = candidates.where(:city => params['city'], :industry => params['industry'])
dataset.full_text_search(:experience, params['search_term']).to_a.to_json
这是给杰里米的!这可能是不可能的,因为我想将 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
有办法吗?非常感谢所有帮助。
我认为您想使用 2 个参数而不是单个散列,就像您的第一个示例一样:
dataset = candidates.where(:city => params['city'], :industry => params['industry'])
dataset.full_text_search(:experience, params['search_term']).to_a.to_json