我有此表达其正在按预期在思考斯芬克斯:如何在(思考)sphinx extended2模式下进行属性匹配?
Customer.search :with => {:signer_id => 23}
但我需要编写一个表达式与某些属性的OR,像signer_id是23或admin_level是42,所以移动到扩展匹配模式和写这个:
Customer.search "@signer_id 23", :match_mode => :extended2
它根据我的Sphinx relevant documentation的理解,应该是等价的,但它并没有在所有匹配任何内容。任何想法我做错了什么?我如何写一个思维扩展的狮身人面像表达式?
复制和从控制台粘贴:
ruby-1.8.7-p302 > Customer.search(:with => {:signer_id => 23}).count
=> 20
ruby-1.8.7-p302 > Customer.search "@signer_id 23", :match_mode => :extended2
=> []
ruby-1.8.7-p302 > Customer.search("@signer_id 23", :match_mode => :extended2).count
=> 0
更新:固定的ID(32 - > 23)。
我犯了同样的错误和数学奥运会;他们不敢相信像我这样的白痴竟然赢了它;)无论如何,我只是在这里犯了错误,代码很好,仍然没有工作。 – Pablo 2010-09-17 16:16:20
我在这里重写了我的答案。 – 2010-09-20 03:40:52