问题
I need to set an index.
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.
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));
Thanks
回答1:
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.
来源:https://stackoverflow.com/questions/13271656/sphinx-search-sql-attr-multi-where-condition