# Check whether document exists from Python client?

**URL:** <https://discuss.elastic.co/t/check-whether-document-exists-from-python-client/106544>\
**Category:** Elasticsearch\
**Created:** [November 6, 2017, 2:40pm UTC](https://discuss.elastic.co/t/check-whether-document-exists-from-python-client/106544 "2017-11-06T14:40:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![TimWard](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timward/32/19574_2.png) [@TimWard](https://discuss.elastic.co/u/TimWard)\
**Post date:** [November 6, 2017, 2:40pm UTC](https://discuss.elastic.co/t/check-whether-document-exists-from-python-client/106544/1 "2017-11-06T14:40:47Z")

</div>

You're supposed to use a HEAD request to check whether a document exists, but I can't find a way of doing this from the Python client?

The documentation of Elasticsearch.exists() doesn't say which it uses, but some of the parameters included don't make sense if it's not doing a GET. Puzzlingly, there's also an Elasticsearch.exists\_source(), but the documentation doesn't appear to give any clues at all as to what it does.

[https://elasticsearch-py.readthedocs.io/en/master/api.html#elasticsearch](https://elasticsearch-py.readthedocs.io/en/master/api.html#elasticsearch)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 4, 2017, 2:40pm UTC](https://discuss.elastic.co/t/check-whether-document-exists-from-python-client/106544/2 "2017-12-04T14:40:56Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
