I've found that refreshing the index after I create it and before I close 
it solves this issue. This may not be 'best practice'

On Wednesday, November 27, 2013 7:23:26 AM UTC-8, Stefan Meiwald wrote:
>
> I thought I could get around another Index/datastore that holds 
> "placeholder" indices for the first 10 minutes but it seems that this would 
> be the best solution maybe.
>
> Am Mittwoch, 27. November 2013 15:48:12 UTC+1 schrieb Stefan Meiwald:
>>
>> Hey,
>>
>> I am wondering if there is a way to wait for the Primary Shard Allocation 
>> before I try to close an Index with the Java API. My usecase is to create 
>> an index and close it immediately afterwards.
>> If I run both Java statements in a direct sequence I get often the 
>> Exception: class 
>> org.elasticsearch.indices.IndexPrimaryShardNotAllocatedException
>> Is there any way to wait for the primary shard allocation when I try to 
>> close the Index? Something like setRefresh(true) when indexing new 
>> documents?
>>
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/37e84108-ebe6-4cb5-8fe3-6922d6434315%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to