1

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?

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
Vitor Baptista
  • 2,016
  • 1
  • 23
  • 28

1 Answers1

0

According to this page: http://vladzloteanu.wordpress.com/2009/01/25/searchlogic-plugin-activerecord-search-on-steroids/

You can probably use:

User.search.conditions.group("column1,column2")
Taryn East
  • 27,486
  • 9
  • 86
  • 108