# NEST: Verify connection with ES?

**URL:** <https://discuss.elastic.co/t/nest-verify-connection-with-es/65266>\
**Category:** Elasticsearch\
**Created:** [November 7, 2016, 7:41pm UTC](https://discuss.elastic.co/t/nest-verify-connection-with-es/65266 "2016-11-07T19:41:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![agonzalez](https://avatars.discourse-cdn.com/v4/letter/a/ba8739/32.png) [@agonzalez](https://discuss.elastic.co/u/agonzalez)\
**Post date:** [November 7, 2016, 7:41pm UTC](https://discuss.elastic.co/t/nest-verify-connection-with-es/65266/1 "2016-11-07T19:41:40Z")

</div>

Is there anyway to test connectivity with elasticsearch?

if there are no connection to ES NEST will try to index but after a while doesnt raise exception just return invalid result.

What is proper way to check connectivy before trying to index documents?

---

<div class="post-metadata">

**Author:** ![KodrAus](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kodraus/32/22798_2.png) [@KodrAus](https://discuss.elastic.co/u/KodrAus)\
**Post date:** [November 7, 2016, 9:07pm UTC](https://discuss.elastic.co/t/nest-verify-connection-with-es/65266/2 "2016-11-07T21:07:48Z")

</div>

You should be able to call `Ping` on your `ElasticClient`. This will send a simple http `HEAD` request to your Elasticsearch host that will respond with a success code if it's alive and cooking.

---

<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 5, 2016, 9:07pm UTC](https://discuss.elastic.co/t/nest-verify-connection-with-es/65266/3 "2016-12-05T21:07:48Z")

</div>

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