REST High Level Client: CreateIndexRequest Timeout


I'm trying to create an index:

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

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):

      "mappings": {
        "_doc": {
          "properties": {
            "documents": {
              "properties": {
                "importDateTime": {
                  "type": "date"

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

The settings file is:

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

Hope this helps.

thanks, i got it working with your example

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