0

我如何在 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
4

1 回答 1

1

创建虚拟属性。例如。

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

只需使 100000 大于您的最高 resource_id

于 2012-07-23T12:49:48.743 回答