# Trasnform - number of shards defined in the template is not applied

**URL:** <https://discuss.elastic.co/t/trasnform-number-of-shards-defined-in-the-template-is-not-applied/255107>\
**Category:** Elasticsearch\
**Tags:** transforms\
**Created:** [November 11, 2020, 6:09pm UTC](https://discuss.elastic.co/t/trasnform-number-of-shards-defined-in-the-template-is-not-applied/255107 "2020-11-11T18:09:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hamza\_BENNANI](https://avatars.discourse-cdn.com/v4/letter/h/bc8723/32.png) [@Hamza\_BENNANI](https://discuss.elastic.co/u/Hamza_BENNANI)\
**Post date:** [November 11, 2020, 6:09pm UTC](https://discuss.elastic.co/t/trasnform-number-of-shards-defined-in-the-template-is-not-applied/255107/1 "2020-11-11T18:09:43Z")

</div>

Hi,

I have defined an index template with 4 shards, ILM policy and fields mapping. When I execute my Transform, every thing defined in the template is applied except the number of shards. My ElasticSearch version is 7.6.2. I know that Transform is in beta version on 7.6.2, is this a bug or an expected thing ?

By the way, my actual workaround is to create manually my index with the wanted number of shards before executing the Transform.

Regards,  
Hamza

---

<div class="post-metadata">

**Author:** ![sophie\_chang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sophie_chang/32/18008_2.png) [@sophie\_chang](https://discuss.elastic.co/u/sophie_chang)\
**Post date:** [November 11, 2020, 6:58pm UTC](https://discuss.elastic.co/t/trasnform-number-of-shards-defined-in-the-template-is-not-applied/255107/2 "2020-11-11T18:58:38Z")

</div>

Hi @Hamza_BENNANI

This is expected behaviour and your workaround is recommended if you need to apply alternative mappings. We updated recent documentation to reflects this.  
[https://www.elastic.co/guide/en/elasticsearch/reference/current/put-transform.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/put-transform.html) (although this is not in the 7.6 docs).

Best wishes  
Sophie

---

<div class="post-metadata">

**Author:** ![Hamza\_BENNANI](https://avatars.discourse-cdn.com/v4/letter/h/bc8723/32.png) [@Hamza\_BENNANI](https://discuss.elastic.co/u/Hamza_BENNANI)\
**Post date:** [November 11, 2020, 8:21pm UTC](https://discuss.elastic.co/t/trasnform-number-of-shards-defined-in-the-template-is-not-applied/255107/3 "2020-11-11T20:21:35Z")

</div>

Hi @sophie_chang,

Thank you for your quick answer. Could you please explain why it's expected to have only 1 Primary shard?

By the way, for performances reasons, I need to set more than 1 Primary shard.

Regards,  
Hamza

---

<div class="post-metadata">

**Author:** ![sophie\_chang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sophie_chang/32/18008_2.png) [@sophie\_chang](https://discuss.elastic.co/u/sophie_chang)\
**Post date:** [November 12, 2020, 2:04pm UTC](https://discuss.elastic.co/t/trasnform-number-of-shards-defined-in-the-template-is-not-applied/255107/4 "2020-11-12T14:04:13Z")

</div>

Hi @Hamza_BENNANI

There is a lot of discussion regarding default of 1 shard here [https://github.com/elastic/elasticsearch/pull/30539](https://github.com/elastic/elasticsearch/pull/30539)

Please use the workaround to create the destination index with a higher shard count.

If you upgrade to 7.7+ the transforms preview endpoint will also return the generated mappings, making it easier to see the deduced mappings and index settings. You then have the option to override by manually creating the index instead.

> **[Preview transform API | Elasticsearch Reference \[7.10\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-transform.html)**

Hope this helps.  
Sophie

---

<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:** [December 10, 2020, 2:04pm UTC](https://discuss.elastic.co/t/trasnform-number-of-shards-defined-in-the-template-is-not-applied/255107/5 "2020-12-10T14:04:16Z")

</div>

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