Have search_exists only return boolean like other exists APIs

Fixes #272
This commit is contained in:
Honza Král
2015-10-07 17:36:12 +02:00
parent 3400179153
commit 140ebd022f
+6 -3
View File
@@ -1302,9 +1302,12 @@ class Elasticsearch(object):
:arg q: Query in the Lucene query string syntax
:arg routing: Specific routing value
"""
_, data = self.transport.perform_request('POST', _make_path(index,
doc_type, '_search', 'exists'), params=params, body=body)
return data
try:
self.transport.perform_request('POST', _make_path(index,
doc_type, '_search', 'exists'), params=params, body=body)
except NotFoundError:
return False
return True
@query_params('allow_no_indices', 'expand_wildcards', 'fields',
'ignore_unavailable', 'level')