# IndexMissingException when creating Client using Java

**URL:** <https://discuss.elastic.co/t/indexmissingexception-when-creating-client-using-java/107445>\
**Category:** Elasticsearch\
**Created:** [November 13, 2017, 5:24pm UTC](https://discuss.elastic.co/t/indexmissingexception-when-creating-client-using-java/107445 "2017-11-13T17:24:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Natalia\_Kuleniuk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/natalia_kuleniuk/32/43727_2.png) [@Natalia\_Kuleniuk](https://discuss.elastic.co/u/Natalia_Kuleniuk)\
**Post date:** [November 13, 2017, 5:24pm UTC](https://discuss.elastic.co/t/indexmissingexception-when-creating-client-using-java/107445/1 "2017-11-13T17:24:00Z")

</div>

I am getting IndexMissingExeption all time I try to perform search using Java.

```
Exception in thread "main" org.elasticsearch.indices.IndexMissingException: [myindex] missing

```

The Exception is occurred on line, where I do execute() search

```
        Node node = nodeBuilder().clusterName("myname").node();
        Client client = node.client();

        SearchResponse scrollResp = client.prepareSearch("myindex", "mytype")
                .setScroll(new TimeValue(60000)).setSize(10)
                .execute().actionGet();

```

Index name/cluster name is correct. Index is working, I can perform any operation with index using Curl. Is there something I am missing?

---

<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:** [November 13, 2017, 5:36pm UTC](https://discuss.elastic.co/t/indexmissingexception-when-creating-client-using-java/107445/2 "2017-11-13T17:36:36Z")

</div>

> `Node node = nodeBuilder().clusterName("myname").node();`

I think you are using may be an old elasticsearch version. FWIW you can not embed elasticsearch like this anymore.  
Which makes me think here that you just created a Node running locally which does not have any index created.

---

<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 11, 2017, 5:36pm UTC](https://discuss.elastic.co/t/indexmissingexception-when-creating-client-using-java/107445/3 "2017-12-11T17:36:38Z")

</div>

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