MCPcopy Create free account
hub / github.com/django-haystack/django-haystack / spelling_suggestion

Method spelling_suggestion

haystack/query.py:578–592  ·  view source on GitHub ↗

Returns the spelling suggestion found by the query. To work, you must set ``INCLUDE_SPELLING`` within your connection's settings dictionary to ``True``. Otherwise, ``None`` will be returned. This will cause the query to execute and should generally be used when

(self, preferred_query=None)

Source from the content-addressed store, hash-verified

576 return clone
577
578 def spelling_suggestion(self, preferred_query=None):
579 """
580 Returns the spelling suggestion found by the query.
581
582 To work, you must set ``INCLUDE_SPELLING`` within your connection's
583 settings dictionary to ``True``. Otherwise, ``None`` will be returned.
584
585 This will cause the query to execute and should generally be used when
586 presenting the data.
587 """
588 if self.query.has_run():
589 return self.query.get_spelling_suggestion(preferred_query)
590 else:
591 clone = self._clone()
592 return clone.query.get_spelling_suggestion(preferred_query)
593
594 def values(self, *fields):
595 """

Callers 1

get_suggestionMethod · 0.45

Calls 3

_cloneMethod · 0.95
has_runMethod · 0.80

Tested by

no test coverage detected