# Create dynamically type

**URL:** <https://discuss.elastic.co/t/create-dynamically-type/274788>\
**Category:** Elasticsearch\
**Created:** [June 2, 2021, 5:51pm UTC](https://discuss.elastic.co/t/create-dynamically-type/274788 "2021-06-02T17:51:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abdoul\_Kande](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abdoul_kande/32/89684_2.png) [@Abdoul\_Kande](https://discuss.elastic.co/u/Abdoul_Kande)\
**Post date:** [June 2, 2021, 5:51pm UTC](https://discuss.elastic.co/t/create-dynamically-type/274788/1 "2021-06-02T17:51:56Z")

</div>

How can i create dynamically type in index ?  
Or in \_doc, create multiple \_type

---

<div class="post-metadata">

**Author:** ![ylasri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ylasri/32/86120_2.png) [@ylasri](https://discuss.elastic.co/u/ylasri)\
**Post date:** [June 2, 2021, 6:29pm UTC](https://discuss.elastic.co/t/create-dynamically-type/274788/2 "2021-06-02T18:29:31Z")

</div>

What's you use case ?  
\_type is deprecrecated since Elasticsearch 6.x and will be removed completely in 8  
\_doc is the defaut, but it's more a Rest endpoint  
If you could explain more your issue, we may guide you in a different way to achieve it

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [June 3, 2021, 12:46am UTC](https://discuss.elastic.co/t/create-dynamically-type/274788/3 "2021-06-03T00:46:48Z")

</div>

Don't use `_type`, create another, normal field in your doc called `type` and just use that.

---

<div class="post-metadata">

**Author:** ![Abdoul\_Kande](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abdoul_kande/32/89684_2.png) [@Abdoul\_Kande](https://discuss.elastic.co/u/Abdoul_Kande)\
**Post date:** [June 3, 2021, 1:24am UTC](https://discuss.elastic.co/t/create-dynamically-type/274788/4 "2021-06-03T01:24:13Z")

</div>

I’m using streamsets for reading excel file from ftp folder  
And i want to store these files content into elasticsearch ( using http client )  
The the problem is there are multiple files and create topic for each file will be hard  
Now i want to create one index (data\_index) and create a type for each file into this index with the filename  
I want something like (if possible):  
Index\_data  
`ˋ`  
{  
"file1":{

},  
"file2":{

},  
…  
}  
`ˋ`

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [June 3, 2021, 3:37am UTC](https://discuss.elastic.co/t/create-dynamically-type/274788/5 "2021-06-03T03:37:50Z")

</div>

There is a good example of before and after on [this page](https://www.elastic.co/guide/en/elasticsearch/reference/current/removal-of-types.html)

The tweet and user example.

Most likely you can just follow this pattern.

---

<div class="post-metadata">

**Author:** ![Abdoul\_Kande](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abdoul_kande/32/89684_2.png) [@Abdoul\_Kande](https://discuss.elastic.co/u/Abdoul_Kande)\
**Post date:** [June 3, 2021, 10:12am UTC](https://discuss.elastic.co/t/create-dynamically-type/274788/6 "2021-06-03T10:12:00Z")

</div>

Thank you

---

<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 1, 2021, 10:12am UTC](https://discuss.elastic.co/t/create-dynamically-type/274788/7 "2021-07-01T10:12:22Z")

</div>

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