sphinx在分组中有两个参数

时间:2012-07-20 12:58:46

标签: mysql linux sphinx

如何为Sphinx中的GROUP BY提供多个属性

    sphinx.conf

    sql_attr_uint     = brand_id
    sql_attr_uint     = resource_id
    sql_attr_uint     = is_truck
    sql_attr_uint     = kind

示例:

    SELECT 
            * 
    FROM 
            some_table
    GROUP BY 
            brand_id, resource_id

斯皮克斯告诉我:

    SQLSTATE[42000]: Syntax error or access violation: 1064 sphinxql: syntax error, unexpected ',', expecting $end near ', resource_id

1 个答案:

答案 0 :(得分:1)

创建虚拟属性。例如。

SELECT 
        *, (brand_id*100000)+resource_id as myint
FROM 
        some_table
GROUP BY 
        myint

只需将100000大于最高资源量_id