# moveToPrimary()

**URL:** <https://discuss.elastic.co/t/movetoprimary/6117>\
**Category:** Elasticsearch\
**Created:** [December 10, 2011, 2:35pm UTC](https://discuss.elastic.co/t/movetoprimary/6117 "2011-12-10T14:35:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![BARNEY](https://avatars.discourse-cdn.com/v4/letter/b/48db29/32.png) [@BARNEY](https://discuss.elastic.co/u/BARNEY)\
**Post date:** [December 10, 2011, 2:35pm UTC](https://discuss.elastic.co/t/movetoprimary/6117/1 "2011-12-10T14:35:50Z")

</div>

Correct me if I am wrong,I changed the particular shard to primary(set  
primary=true) using moveToPrimary() method using master java API.  
Is this the right way of doing?  
Why I am asking bcz in mobz its not showing that particular shard has  
been changed to primary But I printed using master java API its  
showing changed.

Thanks !!

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [December 12, 2011, 12:44pm UTC](https://discuss.elastic.co/t/movetoprimary/6117/2 "2011-12-12T12:44:16Z")

</div>

Thats quite an internal API, and requires more work to move a shard to  
primary (like publishing a new cluster state, and de-allocating other  
shards - this does not happen in elasticsearch when all shards are  
allocated).

On Sat, Dec 10, 2011 at 4:35 PM, BARNEY [kalyanc007@gmail.com](mailto:kalyanc007@gmail.com) wrote:

> Correct me if I am wrong,I changed the particular shard to primary(set  
> primary=true) using moveToPrimary() method using master java API.  
> Is this the right way of doing?  
> Why I am asking bcz in mobz its not showing that particular shard has  
> been changed to primary But I printed using master java API its  
> showing changed.
> 
> Thanks !!

---

<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:45am UTC](https://discuss.elastic.co/t/movetoprimary/6117/3 "2017-07-06T03:45:43Z")

</div>

Closed on July 6, 2017, 3:45am UTC


