Djangonaut
Djangonaut

Reputation: 5821

apache solr auto suggestions

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 ?

Upvotes: 0

Views: 1367

Answers (2)

soField
soField

Reputation: 2696

you need to add spelling support to your default request handler in solr conf see this please

http://wiki.apache.org/solr/SpellCheckComponent

Upvotes: 0

Philip Southam
Philip Southam

Reputation: 16475

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

Upvotes: 1

Related Questions