I have the following question, I have the city(name, uf, province)
model I'm trying to implement the sunspot search method, 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 database:
1 Medianeira PR 3
2 Cascavel PR 4
3 Cascavemat PR 3
If I type for example "Rattlesnake" it brings the right search, but if I type "Bark" I want it to bring all cities that have these words related to the name. Does anyone know how I do this?