Are you using Thinking Sphinx v3? Try each_with_group instead.
And if not, which version of Thinking Sphinx are you using?
On 17/03/2013, at 1:39 PM, Aditya Naik wrote:
> Here is the code so far
> @restuarant = Restaurant.search(:with => {:city_id => @city.id})
> @result = @restuarant.search(
> :conditions => {
> :cuisines => "(#{params[:cuisine].split(/,/).join(") | (")})",
> :locality_name => "(#{params[:locality].split(/,/).join(") |
> (")})"
> },
> :group_by => 'locality_id',
> :group_function => :attr
> )
>
> @result.each_with_groupby{ |r, g| [r,g]}
>
>
> When I do the last statement I get this..
>
> NoMethodError: undefined method `each_with_groupby' for
> #<Restaurant:0x007f9068da3680>
>
> Any Ideas why?
>
> I am trying to get to this
>
> locality_id_1
> restaurant_id_1
> restaurant_id_2
> restaurant_id_3
> locality_id_2
> restaurant_id_4
> restaurant_id_5
>
> thanks in advance
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Thinking Sphinx" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/thinking-sphinx?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
--
You received this message because you are subscribed to the Google Groups
"Thinking Sphinx" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/thinking-sphinx?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.