I have everything properly configured for spelling suggestions in Haystack with Solr, but, when using the SearchView, the suggestion context variable does not get set. I have realized that this is due to https://github.com/toastdriven/django-haystack/commit/8bf366b6781b22810696b18723da5902ce01e5b7:
if self.results and hasattr(self.results, 'query') and self.results.query.backend.include_spelling:
context['suggestion'] = self.form.get_suggestion()
It appears here that the variable is set only if there are results, which clearly doesn’t seem right. I’d really appreciate it if anyone could point me in the right direction.
You may override the create_response of your SearchView (rolling back the patch you mentioned):