views:

285

answers:

1

I use solr+django-haystack

I set settings.HAYSTACK_INCLUDE_SPELLING = True and rebuild index

I'm trying to get any suggestion using: SearchQuerySet().auto_query('tryng ani word her').spelling_suggestion()

But I always get None

What should I do to get at least one working suggestion ? may be I need add some configuration into solr config or have some specific data indexed ?

A: 

Depending on what version of solr you're using you could use EdgeNGrams or the TermsComponent (if your using 1.4). Check out these links, they should get you started in the right direction. I haven't used haystack, so I don't know if there's an easy way to use leverage these solutions in that framework.

EdgeNGrams:

www.lucidimagination.com/blog/2009/09/08/auto-suggest-from-popular-queries-using-edgengrams/

TermsComponent:

wiki.apache.org/solr/TermsComponent

www.lucidimagination.com/search/document/CDRG_ch07_7.13.3

Philip Southam