I get "No" for spelling suggestions.
First, I set this parameter in the settings.py file:
HAYSTACK_INCLUDE_SPELLING = True
I rebuilt the index:
python manage.py rebuild_index
and updated it for a good grade
python manage.py update_index
Search is working correctly. When I search for βChargerβ, it returns results that match. So, in my views.py, I then tried:
from haystack.query import SearchQuerySet
def testpage(request):
test_results = SearchQuerySet().auto_query('Chargr')
spelling_suggestion = test_results.spelling_suggestion()
return render_to_response('testpage.html', {
'test': test_results,
'spelling_suggestion': spelling_suggestion
})
However, my template is:
<html>
<body>
{{ test }}<p>
{{ spelling_suggestion }}
</body>
</html>
Still returns nothing:
[]
None
Obviously, I did not expect anything for {{test}}, but should I not get something for {{spelling_suggestion}}? What am I missing?
source
share