How to map documents of same index with different field


(Aadarsh Kumayan) #1

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