【问题标题】:How to set group by for multiple fields in sphinx config source sql如何在 sphinx config source sql 中为多个字段设置分组依据
【发布时间】:2012-06-05 15:23:57
【问题描述】:

我需要为我的 sphinx 配置源 sql 中的多个字段设置分组依据。

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

我的 sphinx 版本是 204。现在我在旋转索引时遇到了这个错误。

【问题讨论】:

    标签: php search configuration sphinx


    【解决方案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

    【讨论】:

      猜你喜欢
      • 2013-05-13
      • 1970-01-01
      • 2023-03-09
      • 1970-01-01
      • 2015-10-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多