Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9205371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:56:08+00:00 2026-06-17T23:56:08+00:00

I have everything properly configured for spelling suggestions in Haystack with Solr, but, when

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T23:56:09+00:00Added an answer on June 17, 2026 at 11:56 pm

    You may override the create_response of your SearchView (rolling back the patch you mentioned):

    class MySearchView(SearchView):
        def create_response(self):
            (paginator, page) = self.build_page()
    
            context = {
                'query': self.query,
                'form': self.form,
                'page': page,
                'paginator': paginator,
                'suggestion': None,
            }
    
            if self.results.query.backend.include_spelling:
                context['suggestion'] = self.form.get_suggestion()
    
            context.update(self.extra_context())
            return render_to_response(self.template, context, context_instance=self.context_class(self.request))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created my own custom role provider class SGI_RoleProvider and configured properly. Everything
I am using KOLite on a project, and have everything working properly. The activity
I'm a complete Codeigniter noob. I think I have everything setup properly, and the
I have created a custom ExpandableListAdapter and everything works properly. What I'd like to
I'm having trouble making python print out texts properly aligned. I have tried everything
I have wrote a custom MultipleChoiceField. I have everything working ok but when I
I'm trying to set up autoconf for my project. I have everything working properly
I have installed Sonar and configured it to analyze our (.NET) projects (using Sonar-Runner).
I have a navigationControll with several views. Everything works properly. I now want to
I have properly configured Open Graph meta tags on my webpage so when someone

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.