如何在sphinx配置源sql中为多个字段设置group by

问题描述 投票:0回答:1

我需要在我的sphinx配置源sql中为多个字段设置group by。

select f1,f2,f3,f5 from table group by f2,f3,f5;

像这样我需要sql

为此我创建了这样的源代码

source myindex
{
    type            = mysql

    sql_host        = localhost
    sql_user        = root
    sql_pass        = root
    sql_db          = mydb
    sql_port        = 3306  # optional, default is 3306
    sql_query = \
    select f1,f2,f3,f4 from table;

    sql_group_column = f2;
    sql_group_column = f3;
    sql_group_column = f4;

}

我知道我的配置文件是否正确?

WARNING: key 'sql_group_column' is deprecated in /etc/sphinx/sphinx.conf line 27; use 'sql_attr_uint' instead

我的狮身人面像版本是204.现在我在旋转索引时收到此错误。

php search configuration sphinx
1个回答
1
投票

更改

sql_group_column = f2;
sql_group_column = f3;
sql_group_column = f4;

sql_attr_uint = f2;
sql_attr_uint = f3;
sql_attr_uint = f4;

或者对于不同的属性类型f2,f3,f4使用Sphinx attributes

© www.soinside.com 2019 - 2024. All rights reserved.