Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/52.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 思考斯芬克斯未知标识符groupby_Ruby On Rails_Thinking Sphinx - Fatal编程技术网

Ruby on rails 思考斯芬克斯未知标识符groupby

Ruby on rails 思考斯芬克斯未知标识符groupby,ruby-on-rails,thinking-sphinx,Ruby On Rails,Thinking Sphinx,根据文档,我尝试使用Thinking Sphinx搜索和group_by option: 但是这段代码生成了不正确的Sphinx查询 SELECT *, groupby() as sphinx_internal_group, count(*) as sphinx_internal_count FROM `point_core`, `point_delta` WHERE MATCH('point') AND `sphinx_deleted` = 0 GROUP BY `tour_id` LI

根据文档,我尝试使用Thinking Sphinx搜索和group_by option:

但是这段代码生成了不正确的Sphinx查询

SELECT *, groupby() as sphinx_internal_group, count(*) as sphinx_internal_count 
FROM `point_core`, `point_delta` 
WHERE MATCH('point') AND `sphinx_deleted` = 0 
GROUP BY `tour_id` LIMIT 0, 20
这会引起错误:

ThinkingSphinx::ParseError: index point_core,point_delta: 
parse error: unknown identifier 'groupby' (not an attribute, not a function) - 
SELECT *, groupby() as sphinx_internal_group, count(*) as sphinx_internal_count 
FROM `point_core`, `point_delta` WHERE MATCH('point') AND `sphinx_deleted` = 0 
GROUP BY `tour_id` LIMIT 0, 20; SHOW META
我使用的是thinking-sphinx-3.1.1


按选项使用分组的正确方式是什么?

听起来您使用的是Sphinx 2.0.x-思考Sphinx v3.1.x默认情况下需要Sphinx 2.1.x。但您可以按照Sphinx2.0.x所期望的方式行事。

是的。旧斯芬克斯是邪恶的根源。我安装的Sphinx版本是Sphinx2.0.4,目前我已将其升级到2.1.9。所以,现在它的工作完美。谢谢你,帕特。
ThinkingSphinx::ParseError: index point_core,point_delta: 
parse error: unknown identifier 'groupby' (not an attribute, not a function) - 
SELECT *, groupby() as sphinx_internal_group, count(*) as sphinx_internal_count 
FROM `point_core`, `point_delta` WHERE MATCH('point') AND `sphinx_deleted` = 0 
GROUP BY `tour_id` LIMIT 0, 20; SHOW META