# How to map documents of same index with different field

**URL:** <https://discuss.elastic.co/t/how-to-map-documents-of-same-index-with-different-field/158563>\
**Category:** Elasticsearch\
**Created:** [November 28, 2018, 12:04pm UTC](https://discuss.elastic.co/t/how-to-map-documents-of-same-index-with-different-field/158563 "2018-11-28T12:04:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AadarshKumayan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aadarshkumayan/32/18790_2.png) [@AadarshKumayan](https://discuss.elastic.co/u/AadarshKumayan)\
**Post date:** [November 28, 2018, 12:04pm UTC](https://discuss.elastic.co/t/how-to-map-documents-of-same-index-with-different-field/158563/1 "2018-11-28T12:04:34Z")

</div>

Hello Team , i am using elastic search to save json data of two categories . I am using elastic search version 5.6.  
I have 2 types of documents

Now the only difference in those two types is the hash map fields

1. 

```
{
"category":"B",
"meta": 
{
      "publishedAt": "Tue Nov 13 11:14:46 IST 2018",
      "thumbnailurl" : "https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcTWYL_yUMQYceX3HXuYEDg9M6344swerDZqAd05O1taes7J0KfL"
      "url": "https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcTWYL_yUMQYceX3HXuYEDg9M6344swerDZqAd05O1taes7J0KfL",
      "height": "448"
 }
}

```

2. 

```
{
"category":"B",
"meta": 
{
      "publishedAt": "Tue Nov 13 11:14:46 IST 2018",          
      "stream url": "https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcTWYL_yUMQYceX3HXuYEDg9M6344swerDZqAd05O1taes7J0KfL",
      "thumbnailurl" : "https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcTWYL_yUMQYceX3HXuYEDg9M6344swerDZqAd05O1taes7J0KfL"
      "url": "https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcTWYL_yUMQYceX3HXuYEDg9M6344swerDZqAd05O1taes7J0KfL",
      "height": "448"
 }
}

```

My second document only contains one extra field ,should i use different index type for the second document or not

After elastic search 6.0 type has been removed , so what will happen if I save two documents containing few different fields under same index

How will it affect querry performance because there will be lot of spaces in that extra field when i scale up to 1000 entries per day

---

<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 26, 2018, 12:04pm UTC](https://discuss.elastic.co/t/how-to-map-documents-of-same-index-with-different-field/158563/2 "2018-12-26T12:04:35Z")

</div>

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