Skip to content

Commit 79491d5

Browse files
committed
ElasticSearch backend: run() kwargs are passed directly to search backend
This allows customization by subclasses and also fixes django-haystack#888 by ensuring that the custom field list prepared by `ValuesQuerySet` and `ValuesListQuerySet` is actually used.
1 parent 9867b29 commit 79491d5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

haystack/backends/elasticsearch_backend.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -911,6 +911,10 @@ def run(self, spelling_query=None, **kwargs):
911911
"""Builds and executes the query. Returns a list of search results."""
912912
final_query = self.build_query()
913913
search_kwargs = self.build_params(spelling_query, **kwargs)
914+
915+
if kwargs:
916+
search_kwargs.update(kwargs)
917+
914918
results = self.backend.search(final_query, **search_kwargs)
915919
self._results = results.get('results', [])
916920
self._hit_count = results.get('hits', 0)

0 commit comments

Comments
 (0)