# Checking the index is exist or not in elastic search 5.6

**URL:** <https://discuss.elastic.co/t/checking-the-index-is-exist-or-not-in-elastic-search-5-6/200347>\
**Category:** Elasticsearch\
**Created:** [September 20, 2019, 6:03am UTC](https://discuss.elastic.co/t/checking-the-index-is-exist-or-not-in-elastic-search-5-6/200347 "2019-09-20T06:03:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Velliyangiri](https://avatars.discourse-cdn.com/v4/letter/v/50afbb/32.png) [@Velliyangiri](https://discuss.elastic.co/u/Velliyangiri)\
**Post date:** [September 20, 2019, 6:03am UTC](https://discuss.elastic.co/t/checking-the-index-is-exist-or-not-in-elastic-search-5-6/200347/1 "2019-09-20T06:03:46Z")

</div>

Java program check whether the index is already present or not .. I have connected elastic search using TransportClient.. How we can used to check the index existness?please reply.Thanks in advance

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [September 20, 2019, 6:14am UTC](https://discuss.elastic.co/t/checking-the-index-is-exist-or-not-in-elastic-search-5-6/200347/2 "2019-09-20T06:14:05Z")

</div>

Please note that [the transport client is being deprecated](https://www.elastic.co/guide/en/elastic-stack-overview/current/java-clients.html) and will no longer be supported from Elasticsearch 8.0 onwards. I would theerfore recommend you use the high-level REST client for Java and have a look at [indices exists API](https://www.elastic.co/guide/en/elasticsearch/client/java-rest/7.3/java-rest-high-indices-exists.html).

I would recommend doing some research of your own by looking through the documentation and potentially searching the internet and this forum before posting questions here. You are likely to get better responses if you actually show that you have put some effort into the problem yourself before coming here.

---

<div class="post-metadata">

**Author:** ![Velliyangiri](https://avatars.discourse-cdn.com/v4/letter/v/50afbb/32.png) [@Velliyangiri](https://discuss.elastic.co/u/Velliyangiri)\
**Post date:** [September 20, 2019, 6:18am UTC](https://discuss.elastic.co/t/checking-the-index-is-exist-or-not-in-elastic-search-5-6/200347/3 "2019-09-20T06:18:46Z")

</div>

But i have a condition to use only TransportClient.So what will be the solution for checking index existness.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [September 20, 2019, 6:55am UTC](https://discuss.elastic.co/t/checking-the-index-is-exist-or-not-in-elastic-search-5-6/200347/4 "2019-09-20T06:55:50Z")

</div>

Here is how I used to do that:

> <https://github.com/dadoonet/elasticsearch-beyonder/blob/es-5.x/src/main/java/fr/pilato/elasticsearch/tools/index/IndexElasticsearchUpdater.java#L175-L177>

HTH

---

<div class="post-metadata">

**Author:** ![Velliyangiri](https://avatars.discourse-cdn.com/v4/letter/v/50afbb/32.png) [@Velliyangiri](https://discuss.elastic.co/u/Velliyangiri)\
**Post date:** [September 20, 2019, 7:02am UTC](https://discuss.elastic.co/t/checking-the-index-is-exist-or-not-in-elastic-search-5-6/200347/5 "2019-09-20T07:02:33Z")

</div>

Thank you

---

<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:** [October 18, 2019, 7:02am UTC](https://discuss.elastic.co/t/checking-the-index-is-exist-or-not-in-elastic-search-5-6/200347/6 "2019-10-18T07:02:40Z")

</div>

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