# Setting number\_of\_shards is not working by elasticsearch-rest-high-level-client(7.6.1)【CLOSED】

**URL:** <https://discuss.elastic.co/t/setting-number-of-shards-is-not-working-by-elasticsearch-rest-high-level-client-7-6-1-closed/228439>\
**Category:** Elasticsearch\
**Created:** [April 17, 2020, 3:55am UTC](https://discuss.elastic.co/t/setting-number-of-shards-is-not-working-by-elasticsearch-rest-high-level-client-7-6-1-closed/228439 "2020-04-17T03:55:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wenjun\_Yin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wenjun_yin/32/48570_2.png) [@Wenjun\_Yin](https://discuss.elastic.co/u/Wenjun_Yin)\
**Post date:** [April 17, 2020, 3:55am UTC](https://discuss.elastic.co/t/setting-number-of-shards-is-not-working-by-elasticsearch-rest-high-level-client-7-6-1-closed/228439/1 "2020-04-17T03:55:06Z")

</div>

Here is my code, the core part is in the red box.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/3/a/3a7e7d65254eb28b7f0352976f560f6ecf6b730a.png)  
After running this code, I check the index setting through Kibana.  
It shows my setting is not working.  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/a/8/a82a2e9208b65ba2f8af82a5db5ff47c1969f178.png)

Is there anyone can help me.  
THANKS

---

<div class="post-metadata">

**Author:** ![Wenjun\_Yin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wenjun_yin/32/48570_2.png) [@Wenjun\_Yin](https://discuss.elastic.co/u/Wenjun_Yin)\
**Post date:** [April 17, 2020, 3:56am UTC](https://discuss.elastic.co/t/setting-number-of-shards-is-not-working-by-elasticsearch-rest-high-level-client-7-6-1-closed/228439/2 "2020-04-17T03:56:08Z")

</div>

By the way, the es server version is 7.6.0.

---

<div class="post-metadata">

**Author:** ![Wenjun\_Yin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wenjun_yin/32/48570_2.png) [@Wenjun\_Yin](https://discuss.elastic.co/u/Wenjun_Yin)\
**Post date:** [April 17, 2020, 6:13am UTC](https://discuss.elastic.co/t/setting-number-of-shards-is-not-working-by-elasticsearch-rest-high-level-client-7-6-1-closed/228439/3 "2020-04-17T06:13:36Z")

</div>

It's my mistake. Somewhere else created an index for me. I did not notice that before.  
Sorry, I'm going to close this discussion.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 17, 2020, 7:59am UTC](https://discuss.elastic.co/t/setting-number-of-shards-is-not-working-by-elasticsearch-rest-high-level-client-7-6-1-closed/228439/4 "2020-04-17T07:59:58Z")

</div>

Thanks for giving a closure.

Next time, could you please don't post images of text as they are hard to read, may not display correctly for everyone, and are not searchable.

Instead, paste the text and format it with `</>` icon or pairs of triple backticks (```), and check the preview window to make sure it's properly formatted before posting it. This makes it more likely that your question will receive a useful answer.

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:** [May 15, 2020, 8:00am UTC](https://discuss.elastic.co/t/setting-number-of-shards-is-not-working-by-elasticsearch-rest-high-level-client-7-6-1-closed/228439/5 "2020-05-15T08:00:02Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
