I'm dig into solr configuration stuff and try to figure out how implement autocomplete feature.
Some details mentioned here http://wiki.apache.org/solr/Suggester/
But I don't want use same dictionary for all site - it is not useful when you have some private data. I mean several companies use search and I want make autocompleate based only on company data. Is it possible to limit autocompleate results scope them with some syntax.
I'm working with Rails 3 and sunspot gem and solr 3.6
Update:
I found gem which updated for rails 3 and necessary configuration documented here is it https://github.com/xponrails/sunspot_autocomplete
Both answers help me to do thats
I am using an EdgeNgram field and make the autocomplete queries against it.
Something like this in your schema.xml:
Querying "test" looks like
Even though I am using a third party app to send out the queries to Solr (Django-Haystack), the above query should be similar to what you are looking for.
Unfortunately it's not possible to filter auto-suggestions made through the
Suggester
. You might want to have a look at this blog I wrote for other options you have. You should consider using either the facet prefix or the NGrams solution described in the article. The Ngrams solution is more flexible and a little more performant I guess but will cause the growth of your index size, while the facet prefix method is ready to go but probably slower. Just give them a try to see which one you prefer.