I'm building a website with RoR and I use Sunspot and the solr Search Engine. I needed to use autocomplete functionality but I couldn't. I knew that Solr has a new thing called suggester but I don't know how to use this with sunspot and in a rails app.
I found a gem called sunspot_autocomplete and I followed what was written, but when I try to reindex I get this error :
rake aborted!
RSolr::Error::Http - 400 Bad Request
Error: ERROR:unknown field 'tags_ac'
The model that is searchable called Experience
and I put this block in it
searchable do
text :tags, :boost => 3
text :title, :boost => 2
text :tips
autocomplete :tags, :using => :tags
end
Finally I found this blog that it sounds good but I don't understand it :(
I need your help in putting the autocomplete functionality in my app. Thanks A lot :)
Update: I finally fixed and made a demo here in the search box.