gpt4 book ai didi

ruby-on-rails - 在 thinking-sphinx 中使用属性进行简单或搜索?

转载 作者:行者123 更新时间:2023-12-04 03:43:56 27 4
gpt4 key购买 nike

是否可以在 thinking-sphinx 中执行简单的“或”搜索?这是伪代码中的一个小例子。

define_index do
...
has :attr_a, :attr_b
end

Object.search @q, :conditions => {...some cond...}, :with => {:attr_a => value_a OR :attr_b => value_b}

谢谢

最佳答案

这是可能的,尽管它比大多数查询要复杂一些 - 您需要使用 Sphinx 的选择查询来完成它。 docs cover this situation .

关于ruby-on-rails - 在 thinking-sphinx 中使用属性进行简单或搜索?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6551427/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com