如何在 Searchlogic 查询中添加 GROUP_BY 子句?
我将 Searchlogic 与 Rails 2.3.5 结合使用,并且需要在查询中添加包含 2 列的 GROUP_BY 子句。我尝试过:
User.search.group = "column1, column2" # Undefined method 'group'
User.search(:group => "column1, column2") # Searchlogic::Search::UnknownConditionError: The group is not a valid condition. You may only use conditions that map to a named scope
但都不起作用。我在 Searchlogic 的文档中找不到任何其他方法。还有其他办法吗?
I'm using Searchlogic with Rails 2.3.5 and I need to do add a GROUP_BY clause with 2 columns to my query. I tried:
User.search.group = "column1, column2" # Undefined method 'group'
User.search(:group => "column1, column2") # Searchlogic::Search::UnknownConditionError: The group is not a valid condition. You may only use conditions that map to a named scope
And neither worked. I couldn't find any other ways in Searchlogic's docs. Is there any other way?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据此页面: http://vladzloteanu .wordpress.com/2009/01/25/searchlogic-plugin-activerecord-search-on-steroids/
您可能可以使用:
According to this page: http://vladzloteanu.wordpress.com/2009/01/25/searchlogic-plugin-activerecord-search-on-steroids/
You can probably use: