{"action":"created","issue":{"url":"https://api.github.com/repos/elastic/elasticsearch-py/issues/230","labels_url":"https://api.github.com/repos/elastic/elasticsearch-py/issues/230/labels{/name}","comments_url":"https://api.github.com/repos/elastic/elasticsearch-py/issues/230/comments","events_url":"https://api.github.com/repos/elastic/elasticsearch-py/issues/230/events","html_url":"https://github.com/elastic/elasticsearch-py/issues/230","id":74031606,"number":230,"title":"search_exists throws an exception","user":{"login":"ncrocfer","id":1552526,"avatar_url":"https://avatars.githubusercontent.com/u/1552526?v=3","gravatar_id":"","url":"https://api.github.com/users/ncrocfer","html_url":"https://github.com/ncrocfer","followers_url":"https://api.github.com/users/ncrocfer/followers","following_url":"https://api.github.com/users/ncrocfer/following{/other_user}","gists_url":"https://api.github.com/users/ncrocfer/gists{/gist_id}","starred_url":"https://api.github.com/users/ncrocfer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ncrocfer/subscriptions","organizations_url":"https://api.github.com/users/ncrocfer/orgs","repos_url":"https://api.github.com/users/ncrocfer/repos","events_url":"https://api.github.com/users/ncrocfer/events{/privacy}","received_events_url":"https://api.github.com/users/ncrocfer/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/elastic/elasticsearch-py/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-05-07T15:41:31Z","updated_at":"2015-05-19T13:19:23Z","closed_at":"2015-05-18T13:51:22Z","body":"Hello,\r\n\r\nI'm using the `search_exists` API to determine if a document exists based on one field, but the client throws an exception when there is no matching.\r\n\r\nFor example, I know this document exists :\r\n```\r\n>>> es = Elasticsearch(...)\r\n>>> es.search_exists('my_index', 'my_type', params={'q': 'my_field:foo'})\r\n{u'exists': True}\r\n```\r\n\r\nBut when a document doesn't exist :\r\n```\r\n>>> es.search_exists('my_index', 'my_type', params={'q': 'my_field:bar'})\r\nTraceback (most recent call last):\r\n  File \"<stdin>\", line 1, in <module>\r\n  File \"/usr/local/lib/python2.7/dist-packages/elasticsearch/client/utils.py\", line 68, in _wrapped\r\n    return func(*args, params=params, **kwargs)\r\n  File \"/usr/local/lib/python2.7/dist-packages/elasticsearch/client/__init__.py\", line 1238, in search_exists\r\n    doc_type, '_search', 'exists'), params=params, body=body)\r\n  File \"/usr/local/lib/python2.7/dist-packages/elasticsearch/transport.py\", line 307, in perform_request\r\n    status, headers, data = connection.perform_request(method, url, params, body, ignore=ignore, timeout=timeout)\r\n  File \"/usr/local/lib/python2.7/dist-packages/elasticsearch/connection/http_urllib3.py\", line 86, in perform_request\r\n    self._raise_error(response.status, raw_data)\r\n  File \"/usr/local/lib/python2.7/dist-packages/elasticsearch/connection/base.py\", line 102, in _raise_error\r\n    raise HTTP_EXCEPTIONS.get(status_code, TransportError)(status_code, error_message, additional_info)\r\nelasticsearch.exceptions.NotFoundError: TransportError(404, u'{\"exists\":false}')\r\n```\r\n\r\nDid I forget something? Thank you."},"comment":{"url":"https://api.github.com/repos/elastic/elasticsearch-py/issues/comments/103485491","html_url":"https://github.com/elastic/elasticsearch-py/issues/230#issuecomment-103485491","issue_url":"https://api.github.com/repos/elastic/elasticsearch-py/issues/230","id":103485491,"user":{"login":"ncrocfer","id":1552526,"avatar_url":"https://avatars.githubusercontent.com/u/1552526?v=3","gravatar_id":"","url":"https://api.github.com/users/ncrocfer","html_url":"https://github.com/ncrocfer","followers_url":"https://api.github.com/users/ncrocfer/followers","following_url":"https://api.github.com/users/ncrocfer/following{/other_user}","gists_url":"https://api.github.com/users/ncrocfer/gists{/gist_id}","starred_url":"https://api.github.com/users/ncrocfer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ncrocfer/subscriptions","organizations_url":"https://api.github.com/users/ncrocfer/orgs","repos_url":"https://api.github.com/users/ncrocfer/repos","events_url":"https://api.github.com/users/ncrocfer/events{/privacy}","received_events_url":"https://api.github.com/users/ncrocfer/received_events","type":"User","site_admin":false},"created_at":"2015-05-19T13:19:23Z","updated_at":"2015-05-19T13:19:23Z","body":"Great ! Thank you @HonzaKral :+1: "}}