开发者

apache solr auto suggestions

开发者 https://www.devze.com 2022-12-22 04:59 出处:网络
I use solr+django-haystack I set settings.HAYSTACK_INCLUDE_SPELLING = True and rebuild index I\'m trying to get any suggestion using:

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 in开发者_开发问答to solr config or have some specific data indexed ?


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


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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消