# Why optimize is not executed on all shards?

**URL:** <https://discuss.elastic.co/t/why-optimize-is-not-executed-on-all-shards/12274>\
**Category:** Elasticsearch\
**Created:** [June 5, 2013, 5:18am UTC](https://discuss.elastic.co/t/why-optimize-is-not-executed-on-all-shards/12274 "2013-06-05T05:18:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jun\_Liu](https://avatars.discourse-cdn.com/v4/letter/j/b9e5f3/32.png) [@Jun\_Liu](https://discuss.elastic.co/u/Jun_Liu)\
**Post date:** [June 5, 2013, 5:18am UTC](https://discuss.elastic.co/t/why-optimize-is-not-executed-on-all-shards/12274/1 "2013-06-05T05:18:07Z")

</div>

I tried to execute optimize operation to one index:

curl -XPOST '  
[http://192.168.2.105:9200/user/\_optimize?max\_num\_segments=5&pretty=true](http://192.168.2.105:9200/user/_optimize?max_num_segments=5&pretty=true)[http://192.168.2.105:9200/weibo\_user\_v1/\_optimize?pretty=true](http://192.168.2.105:9200/weibo_user_v1/_optimize?pretty=true)  
'  
{  
"ok" : true,  
"\_shards" : {  
"total" : 10,  
"successful" : 6,  
"failed" : 0  
}

Why only 6 shards are successful? (The index has 5 shards and 1 replica)

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:32am UTC](https://discuss.elastic.co/t/why-optimize-is-not-executed-on-all-shards/12274/2 "2017-07-06T02:32:53Z")

</div>


