Skip to content

Commit

Permalink
fix for isnull search filter
Browse files Browse the repository at this point in the history
  • Loading branch information
milashensky committed Sep 5, 2018
1 parent 8673d71 commit f354896
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions django_elasticsearch/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,9 @@ def make_search_body(self):

elif operator == 'isnull':
if value:
filtr = {'missing': {'field': field_name}}
filtr = {'bool': {'must_not': [{'exists': {'field': field_name}}]}}
else:
filtr = {'exists': {'field': field_name}}
filtr = {'bool': {'must': [{'exists': {'field': field_name}}]}}

search_filter.update(filtr)

Expand Down

0 comments on commit f354896

Please sign in to comment.