0
votes

Here's the error I'm hitting

NoMethodError: undefined method `group' for Sunspot::Search::StandardSearch:

I have sunspot version 1.2.1 and solr version 3.6. I also tested the grouping functionality with the solr version installed on my server by modifying the url and it works like a breeze.

However it breaks with the current sunspot version I have. I updated the sunspot gem to version 1.3.3 but it still breaks.

I'm pretty sure the syntax is correct because I followed the examples in the documentation:

https://github.com/sunspot/sunspot

I've looked around and this is the relevant answer i've found but doesn't help. Maybe i'm missing something?

Group using Sunspot/Solr?

These are the gems i've got installed:

gem 'sunspot_rails', '1.3.1' gem 'sunspot_solr'

EDIT

Here's the code that is breaking. It is same as the documentation. ':question' is a single value text field I want to group on.

search.group(:question).groups.each do |group|
  puts group.value
 end
1
Could you show the code that produces the error...?polmiro
It is same as in the documentation. question is a single valued text field I want to group on: search.group(:question).groups.each do |group| puts group.value endKaran Verma

1 Answers

0
votes

Problem Solved

Grouping is supported in Sunspot version 2.0.0

Hence the simple fix was just including the sunspot 2.0.0 gem and a bundle install.