On Tue, Nov 9, 2010 at 1:02 PM, Shalin Shekhar Mangar <shalinman...@gmail.com> wrote: > On Tue, Nov 9, 2010 at 8:20 AM, bbarani <bbar...@gmail.com> wrote: > >> >> Hi, >> >> We are trying to implement auto suggest feature in our application. >> >> I would like to know the difference between terms vs spell check component. >> >> Both the handlers seems to display almost the same output, can anyone let >> me >> know the difference and also I would like to know when to go for spell >> check >> and when to go for terms component. >> >> > SpellCheckComponent is designed to operate on whole words and not partial > words so I don't know how well it will work for auto-suggest, if at all. > > As far as differences between SpellCheckComponent and Terms Component is > concerned, TermsComponent is a straight prefix match whereas SCC takes edit > distance into account. Also, SCC can deal with phrases composed of multiple > words and also gives back a collated suggestion. > > -- > Regards, > Shalin Shekhar Mangar. >
An alternative to using the SpellCheckComponent and/or the TermsComponent, would be the (Edge)NGrams filter. Basically, this filter breaks words down into auto-suggest-friendly tokens (i.e., "Hello" => "H", "He", "Hel", "Hell", "Hello") that works great for auto suggestion querying. Here is an article from Lucid Imagination on using the ngram filter: http://www.lucidimagination.com/blog/2009/09/08/auto-suggest-from-popular-queries-using-edgengrams/ Here is the SOLR wiki entry for the filter: http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters#solr.EdgeNGramFilterFactory - Ken Stanley