# No Active Shard error when using Java Api for Search

**URL:** <https://discuss.elastic.co/t/no-active-shard-error-when-using-java-api-for-search/8548>\
**Category:** Elasticsearch\
**Created:** [July 27, 2012, 11:57pm UTC](https://discuss.elastic.co/t/no-active-shard-error-when-using-java-api-for-search/8548 "2012-07-27T23:57:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajasuja18](https://avatars.discourse-cdn.com/v4/letter/a/45deac/32.png) [@ajasuja18](https://discuss.elastic.co/u/ajasuja18)\
**Post date:** [July 27, 2012, 11:57pm UTC](https://discuss.elastic.co/t/no-active-shard-error-when-using-java-api-for-search/8548/1 "2012-07-27T23:57:05Z")

</div>

Hey Everyone,

I am getting the error of No active shards when I am using Java Api to  
perform search  
on the elasticsearch.

What is the simple rule I should follow to avoid these problems..?

Thanks in advance,

---

<div class="post-metadata">

**Author:** ![simonw\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simonw_2/32/1130_2.png) [@simonw\_2](https://discuss.elastic.co/u/simonw_2)\
**Post date:** [July 29, 2012, 7:37am UTC](https://discuss.elastic.co/t/no-active-shard-error-when-using-java-api-for-search/8548/2 "2012-07-29T07:37:25Z")

</div>

this could be anything. Can you provide more info like post your cluster  
state and what index you are searching against, does it work if you go to  
the REST API directly?

simon

On Saturday, July 28, 2012 1:57:05 AM UTC+2, ajasuja wrote:

> Hey Everyone,
> 
> I am getting the error of No active shards when I am using Java Api to  
> perform search  
> on the elasticsearch.
> 
> What is the simple rule I should follow to avoid these problems..?
> 
> Thanks in advance,

---

<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, 3:18am UTC](https://discuss.elastic.co/t/no-active-shard-error-when-using-java-api-for-search/8548/3 "2017-07-06T03:18:34Z")

</div>


