我一直试图让狮身人面像搜索插件为WordPress工作,但遇到了一个划痕。服务器上有Sphinx,源代码附带的测试数据库安装运行良好。然而,当我试图使用狮身人面像搜索插件( 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支持论坛上为这个插件,但没有人答复,已经有一个月以来,有任何活动,所以没有得到我的希望。如有任何建议,我们将不胜感激。
发布于 2015-07-31 13:47:31
我认为这是因为您使用的是MySQL的最新版本,它对GROUP BY查询具有更严格的语义。ONLY_FULL_GROUP_BY选项已打开。
这些错误是由MySQL服务器产生的,indexer只是“报告”--它无法运行配置文件中提供的MySQL查询。
http://www.tocker.ca/2014/01/24/proposal-to-enable-sql-mode-only-full-group-by-by-default.html
https://dev.mysql.com/doc/refman/5.0/en/group-by-handling.html
http://mechanics.flite.com/blog/2013/02/12/why-i-use-only-full-group-by/
该配置文件中的查询是针对较早版本的MySQL的,从历史上看,MySQL非常宽松地按查询编写组。
任一
对于1.充分利用ANY_VALUE()函数
(实际上是该函数的文档,也许是对这个问题最简洁的解释!)
https://stackoverflow.com/questions/31746432
复制相似问题