支持在Heroku中运行Sphinx的HAVING

时间:2014-12-05 18:22:18

标签: heroku sphinx thinking-sphinx

我有以下查询:

  search(params[:query],
    with: { tag_id: params[:filter].values.flatten },
    group_by: :technology_id,
    having: "COUNT(*)=#{params[:filter].size}"
  )

这在本地工作,但是当我部署到heroku时它会抛出:

ActionView::Template::Error (sphinxql: syntax error, unexpected IDENT, expecting $end 
near 'HAVING COUNT(*)=1 LIMIT 0, 20; SHOW META' - SELECT *, groupby() AS 
sphinx_internal_group, id AS sphinx_document_id, count(DISTINCT sphinx_document_id) AS 
sphinx_internal_count FROM `technology_core` WHERE MATCH('cancer') AND `tag_id` IN (1) AND 
`sphinx_deleted` = 0 GROUP BY `technology_id` HAVING COUNT(*)=1 LIMIT 0, 20; SHOW META):

sphinx版本指定如下:

# config/thinking_sphinx.yml
test:
  mysql41: 9307
production:
  version: '2.2.6'

任何人都知道还有什么可以吗?

1 个答案:

答案 0 :(得分:0)

目前,Flying Sphinx服务器上提供的最新Sphinx版本是2.2.3 - 您可以更改thinking_sphinx.yml中的版本,部署并运行重建/重新生成,并查看HAVING是否有效? / p>