# Timeout when trying to create an index via Java API

**URL:** <https://discuss.elastic.co/t/timeout-when-trying-to-create-an-index-via-java-api/16301>\
**Category:** Elasticsearch\
**Created:** [March 11, 2014, 9:59pm UTC](https://discuss.elastic.co/t/timeout-when-trying-to-create-an-index-via-java-api/16301 "2014-03-11T21:59:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mihnea\_Dobrescu\_Bala](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mihnea_dobrescu_bala/32/1738_2.png) [@Mihnea\_Dobrescu\_Bala](https://discuss.elastic.co/u/Mihnea_Dobrescu_Bala)\
**Post date:** [March 11, 2014, 9:59pm UTC](https://discuss.elastic.co/t/timeout-when-trying-to-create-an-index-via-java-api/16301/1 "2014-03-11T21:59:40Z")

</div>

Hello,

I'm trying to create an index with a whitespace default tokenizer using the  
Java API like this:

Settings indexSettings =  
ImmutableSettings.settingsBuilder().put("analysis.analyzer.default.tokenizer",  
"whitespace").build();  
CreateIndexRequest req = new CreateIndexRequest(index, indexSettings);  
client.admin().indices().create(req).actionGet(5000);

This always times out after the 5 seconds in the actionGet call. The code  
is called in the constructor of a river (I need the river to create the  
index). I'm using ES 1.0.1 (both the server and the Java lib).

What am I missing?

Thank you,  
Mihnea

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/0d5a3776-65cc-4f7d-be5b-ff0944ee67eb%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0d5a3776-65cc-4f7d-be5b-ff0944ee67eb%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Mihnea\_Dobrescu\_Bala](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mihnea_dobrescu_bala/32/1738_2.png) [@Mihnea\_Dobrescu\_Bala](https://discuss.elastic.co/u/Mihnea_Dobrescu_Bala)\
**Post date:** [March 12, 2014, 7:17pm UTC](https://discuss.elastic.co/t/timeout-when-trying-to-create-an-index-via-java-api/16301/2 "2014-03-12T19:17:11Z")

</div>

drewr helped me on IRC. The problem was that I was calling the code in  
the constructor of a river, which was called too early. I moved the  
code so that it got called later and all is fine now.

Thanks!  
Mihnea

On Tue, Mar 11, 2014 at 10:59 PM, Mihnea Dobrescu-Balaur  
[mihneadb@gmail.com](mailto:mihneadb@gmail.com) wrote:

> Hello,
> 
> I'm trying to create an index with a whitespace default tokenizer using the  
> Java API like this:
> 
> Settings indexSettings =  
> ImmutableSettings.settingsBuilder().put("analysis.analyzer.default.tokenizer",  
> "whitespace").build();  
> CreateIndexRequest req = new CreateIndexRequest(index, indexSettings);  
> client.admin().indices().create(req).actionGet(5000);
> 
> This always times out after the 5 seconds in the actionGet call. The code is  
> called in the constructor of a river (I need the river to create the index).  
> I'm using ES 1.0.1 (both the server and the Java lib).
> 
> What am I missing?
> 
> Thank you,  
> Mihnea
> 
> --  
> You received this message because you are subscribed to a topic in the  
> Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/elasticsearch/WG-mQSFuPoo/unsubscribe](https://groups.google.com/d/topic/elasticsearch/WG-mQSFuPoo/unsubscribe).  
> To unsubscribe from this group and all its topics, send an email to  
> [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/0d5a3776-65cc-4f7d-be5b-ff0944ee67eb%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0d5a3776-65cc-4f7d-be5b-ff0944ee67eb%40googlegroups.com).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
Mihnea Dobrescu-Balaur

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAGmmvX%2BhO2y\_0FC9XwKnBiCZw7Mm7xocW%3D%2B8FCPeeQNZ9bG8Sw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGmmvX%2BhO2y_0FC9XwKnBiCZw7Mm7xocW%3D%2B8FCPeeQNZ9bG8Sw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [July 6, 2017, 1:43am UTC](https://discuss.elastic.co/t/timeout-when-trying-to-create-an-index-via-java-api/16301/3 "2017-07-06T01:43:42Z")

</div>

Closed on July 6, 2017, 1:43am UTC


