Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
barseghyanartur committed Dec 12, 2017
1 parent 61ae7fe commit b397c49
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/django_elasticsearch_dsl_drf/filter_backends/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,11 @@ def construct_search(self, request, view):
__values = self.split_lookup_value(search_term, 1)
__len_values = len(__values)
if __len_values > 1:
field, value = __values
__queries.append(
Q("match", **{field: value})
)
if field in view.search_fields:
field, value = __values
__queries.append(
Q("match", **{field: value})
)
else:
for field in view.search_fields:
__queries.append(
Expand Down

0 comments on commit b397c49

Please sign in to comment.