# REST High Level Client: CreateIndexRequest Timeout

**URL:** <https://discuss.elastic.co/t/rest-high-level-client-createindexrequest-timeout/161828>\
**Category:** Elasticsearch\
**Created:** [December 21, 2018, 10:08am UTC](https://discuss.elastic.co/t/rest-high-level-client-createindexrequest-timeout/161828 "2018-12-21T10:08:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![higgs01](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/higgs01/32/39094_2.png) [@higgs01](https://discuss.elastic.co/u/higgs01)\
**Post date:** [December 21, 2018, 10:08am UTC](https://discuss.elastic.co/t/rest-high-level-client-createindexrequest-timeout/161828/1 "2018-12-21T10:08:18Z")

</div>

Hello

I'm trying to create an index:

```auto
        client.indices().create(new CreateIndexRequest(indexName)
                .settings(Settings.builder().put("index.number_of_replicas", 0))
                .mapping(shipmentIndexConfiguration, XContentType.JSON),
            RequestOptions.DEFAULT);

```

But Nothing is happening at all. Sometimes i get a exception that the request has timouted (after 30 seconds or so) but most of the time it just goes on for multiple hundred seconds.

If I check the log of the elasticsearch-server i don't see anything correlating to my issue.

If I try to create the index through Kibana everything works fine.

Elastic version: 6.4.2  
Mapping Configuration(shipmentIndexConfiguration):

```auto
    {
      "mappings": {
        "_doc": {
          "properties": {
            "documents": {
              "properties": {
                "importDateTime": {
                  "type": "date"
                }
              }
            }
          }
        }
      }
    }

```

---

<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:** [December 21, 2018, 11:09am UTC](https://discuss.elastic.co/t/rest-high-level-client-createindexrequest-timeout/161828/2 "2018-12-21T11:09:44Z")

</div>

Here is how I'm creating an index using the HLRestClient:

> <https://github.com/dadoonet/fscrawler/blob/master/elasticsearch-client/elasticsearch-client-v6/src/main/java/fr/pilato/elasticsearch/crawler/fs/client/v6/ElasticsearchClientV6.java#L231-L245>

The settings file is:

> <https://github.com/dadoonet/fscrawler/blob/master/settings/src/main/resources/fr/pilato/elasticsearch/crawler/fs/_default/6/_settings.json>

You can see that I'm configuring the whole settings (including number of shards and mapping) within the same json content.

Hope this helps.

---

<div class="post-metadata">

**Author:** ![higgs01](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/higgs01/32/39094_2.png) [@higgs01](https://discuss.elastic.co/u/higgs01)\
**Post date:** [December 21, 2018, 12:43pm UTC](https://discuss.elastic.co/t/rest-high-level-client-createindexrequest-timeout/161828/4 "2018-12-21T12:43:51Z")

</div>

thanks, i got it working with your example

---

<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:** [January 18, 2019, 12:43pm UTC](https://discuss.elastic.co/t/rest-high-level-client-createindexrequest-timeout/161828/5 "2019-01-18T12:43:52Z")

</div>

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