I am using Rails 3.1 and have been using this railscast tutorial to implement sunspot. I am following everything right (i think) however when I run the search like this:
class ProductsController < ApplicationController
# GET /products
# GET /products.xml
def index
@search = Product.search do
fulltext params[:search]
end
@products = @search.results
respond_to do |format|
format.html
format.xml { render :xml => @products }
end
end...
Here's how I have declared the searchable
in my product.rb file
searchable do
text :title
end
However I keep running in to the following error
undefined method `results' for #<MetaSearch::Searches::Product:0x12a089f50>
But when I do just a @products = @search
, i get a full list of all the products, no matter what i send in the search query
Anyone have any idea what I am doing wrong?