Sphinx 搜索 sql_attr_multi - where 条件 [英] Sphinx search sql_attr_multi - where condition
问题描述
我需要设置一个索引.
sql_attr_multi = 来自查询的 uint 类别;SELECT item_id, category_id FROM connections WHERE value=2
sql_attr_multi = uint categories from query; SELECT item_id, category_id FROM connections WHERE value=2
如果我将值设置为静态,它工作正常.
It works fine If I set the value static.
那个值是一个变量,所以我想通过过滤器分配它,但它不起作用,因为我想过滤sql_attr_multi"而不是 $sql.
That value is a variable so I want to assign it through a filter but it doesn`t work because I want to filter "sql_attr_multi" not the $sql.
$cl->setFilter("value", array(2));
$cl->setFilter("value", array(2));
谢谢
推荐答案
setFilter 只与搜索( searchd process )有关.它是应用于属性的过滤器.不能根据条件更改类别 sql_attr_multi 属性值(除非您重新索引或使用 updateAttributes).如果值变化不大,则为每个值创建一个 mva 属性.
setFilter has to do only with searching ( searchd process ). It's a filter applied to an attribute. The categories sql_attr_multi attribute values can't be changed depending on a condition ( unless you reindex or use updateAttributes). If values doesn't vary much , create for each one a mva attribute.
这篇关于Sphinx 搜索 sql_attr_multi - where 条件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!