I have the following questions, I have the model city (name, uf, province)'m trying to implement the method of sunspot research, but I'm getting by:
# modelCity.rb
searchable do
text :name
end
# controller City
unless params[:search]
@cities = City.paginate(:page => params[:page], :order => "name ASC")
else
@search = City.search do
fulltext params[:search]
end
@cities = @search.results
end
city data base:
1 Medianeira PR 3
2 Cascavel PR 4
3 Cascavemat PR 3
If I type for example "Cascavel" he brings a certain quest, but if I type in "Casca" I want him to bring all the cities that have those words related to the name. Anyone know how to do it?
OBS: Using rails 4, followed the tutorial: git sunspot