There is no need for a Haystack fork, you can update this method in your own backend (see the Haystack ElasticSearch Backend Stretch for details ). The build_search_kwargs method returns a dictionary, so you can just change the original return value.
Disclaimer: This code is just an example of how you could update your own backend, not how to implement a fuzzy search.
class FuzzyBackend(ElasticsearchSearchBackend): def build_search_kwargs(self, query_string, **kwargs): fuzzy = kwargs.pop('fuzzy', False) fuzzy_field = kwargs.pop('min_similarity', '') search_kwargs = super(FuzzyBackend, self).build_search_kwargs( query_string, kwargs) if fuzzy: search_kwargs = {'fuzzy': {fuzzy_field: query_string}} return search_kwargs
bennylope
source share