狮身人面像 - 没有 delta:sql_range_query
Sphinx - no delta:sql_range_query
我一直在尝试让 WordPress 的 Sphinx 搜索插件正常工作,但 运行 让人头疼。我在服务器上安装了 Sphinx,并且 运行 可以正常安装源附带的测试数据库。但是,当我尝试使用 Sphinx 搜索插件 (copy here) 提供的 sphinx.conf 索引 WP 时,它拒绝处理。当我通过命令行 运行 它时,我得到以下输出:
# /usr/local/bin/indexer --rotate --config /home/example.com/public_html/wp-content/uploads/sphinx/sphinx.conf dk_delta dk_main dk_stats
Sphinx 2.2.9-id64-release (rel22-r5006)
Copyright (c) 2001-2015, Andrew Aksyonoff
Copyright (c) 2008-2015, Sphinx Technologies Inc (http://sphinxsearch.com)
using config file '/home/example.com/public_html/wp-content/uploads/sphinx/sphinx.conf'...
indexing index 'dk_delta'...
ERROR: index 'dk_delta': sql_range_query: 'example.com.p.post_title' isn't in GROUP BY (DSN=mysql://dekanta_flyus3r:***@localhost:3306/example.com).
total 0 docs, 0 bytes
total 0.003 sec, 0 bytes/sec, 0.00 docs/sec
indexing index 'dk_main'...
ERROR: index 'dk_main': sql_range_query: 'example.com.p.post_title' isn't in GROUP BY (DSN=mysql://dekanta_flyus3r:***@localhost:3306/example.com).
total 0 docs, 0 bytes
total 0.003 sec, 0 bytes/sec, 0.00 docs/sec
indexing index 'dk_stats'...
collected 0 docs, 0.0 MB
total 0 docs, 0 bytes
total 0.003 sec, 0 bytes/sec, 0.00 docs/sec
total 1 reads, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
total 7 writes, 0.000 sec, 0.4 kb/call avg, 0.0 msec/call avg
rotating indices: successfully sent SIGHUP to searchd (pid=20768).
问题肯定是 wordpress 数据库中没有 dk_delta、dk_main 或 dk_stats 表(我使用的是 dk_ 前缀),这让我感到困惑这个插件兼容最新的 wordpress。这让我相信我一定错过了这个过程中的一个重要步骤,例如我是否必须先用 sphinx 索引所有数据库,安装额外的 sql 表等
我已经在 wordpress 支持论坛上发布了此插件的帖子,但没有人回复,并且自从那里 activity 以来已经有一个月了,所以我没有抱太大希望。感谢任何建议,谢谢。
我认为这是因为您使用的是 MySQL 的最新版本,它对 GROUP BY
查询具有更严格的语义。 ONLY_FULL_GROUP_BY
选项已打开。
这些错误是由 MySQL 服务器产生的,indexer
只是 'reporting' 它无法 运行 配置中提供的 MySQL 查询文件。
http://www.tocker.ca/2014/01/24/proposal-to-enable-sql-mode-only-full-group-by-by-default.html
MySQL : isn't in GROUP BY
https://dev.mysql.com/doc/refman/5.0/en/group-by-handling.html
https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_only_full_group_by
http://mechanics.flite.com/blog/2013/02/12/why-i-use-only-full-group-by/
该配置文件中的查询是针对旧版本的 MySQL,历史上 MySQL 非常宽松地编写 GROUP BY 查询。
或者
- MySQL 查询需要更新才能使用 ONLY_FULL_GROUP_BY 启用或
- 可以更改 MySQL 服务器设置以允许这些类型的查询。
对于 1. 自由使用 ANY_VALUE()
函数
http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html#function_any-value
(事实上,该函数的文档可能是对问题最简洁的解释!)
我一直在尝试让 WordPress 的 Sphinx 搜索插件正常工作,但 运行 让人头疼。我在服务器上安装了 Sphinx,并且 运行 可以正常安装源附带的测试数据库。但是,当我尝试使用 Sphinx 搜索插件 (copy here) 提供的 sphinx.conf 索引 WP 时,它拒绝处理。当我通过命令行 运行 它时,我得到以下输出:
# /usr/local/bin/indexer --rotate --config /home/example.com/public_html/wp-content/uploads/sphinx/sphinx.conf dk_delta dk_main dk_stats
Sphinx 2.2.9-id64-release (rel22-r5006)
Copyright (c) 2001-2015, Andrew Aksyonoff
Copyright (c) 2008-2015, Sphinx Technologies Inc (http://sphinxsearch.com)
using config file '/home/example.com/public_html/wp-content/uploads/sphinx/sphinx.conf'...
indexing index 'dk_delta'...
ERROR: index 'dk_delta': sql_range_query: 'example.com.p.post_title' isn't in GROUP BY (DSN=mysql://dekanta_flyus3r:***@localhost:3306/example.com).
total 0 docs, 0 bytes
total 0.003 sec, 0 bytes/sec, 0.00 docs/sec
indexing index 'dk_main'...
ERROR: index 'dk_main': sql_range_query: 'example.com.p.post_title' isn't in GROUP BY (DSN=mysql://dekanta_flyus3r:***@localhost:3306/example.com).
total 0 docs, 0 bytes
total 0.003 sec, 0 bytes/sec, 0.00 docs/sec
indexing index 'dk_stats'...
collected 0 docs, 0.0 MB
total 0 docs, 0 bytes
total 0.003 sec, 0 bytes/sec, 0.00 docs/sec
total 1 reads, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
total 7 writes, 0.000 sec, 0.4 kb/call avg, 0.0 msec/call avg
rotating indices: successfully sent SIGHUP to searchd (pid=20768).
问题肯定是 wordpress 数据库中没有 dk_delta、dk_main 或 dk_stats 表(我使用的是 dk_ 前缀),这让我感到困惑这个插件兼容最新的 wordpress。这让我相信我一定错过了这个过程中的一个重要步骤,例如我是否必须先用 sphinx 索引所有数据库,安装额外的 sql 表等
我已经在 wordpress 支持论坛上发布了此插件的帖子,但没有人回复,并且自从那里 activity 以来已经有一个月了,所以我没有抱太大希望。感谢任何建议,谢谢。
我认为这是因为您使用的是 MySQL 的最新版本,它对 GROUP BY
查询具有更严格的语义。 ONLY_FULL_GROUP_BY
选项已打开。
这些错误是由 MySQL 服务器产生的,indexer
只是 'reporting' 它无法 运行 配置中提供的 MySQL 查询文件。
http://www.tocker.ca/2014/01/24/proposal-to-enable-sql-mode-only-full-group-by-by-default.html
MySQL : isn't in GROUP BY
https://dev.mysql.com/doc/refman/5.0/en/group-by-handling.html
https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_only_full_group_by
http://mechanics.flite.com/blog/2013/02/12/why-i-use-only-full-group-by/
该配置文件中的查询是针对旧版本的 MySQL,历史上 MySQL 非常宽松地编写 GROUP BY 查询。
或者
- MySQL 查询需要更新才能使用 ONLY_FULL_GROUP_BY 启用或
- 可以更改 MySQL 服务器设置以允许这些类型的查询。
对于 1. 自由使用 ANY_VALUE()
函数
http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html#function_any-value
(事实上,该函数的文档可能是对问题最简洁的解释!)