title: MultiLevel Nested Object vs "multiple Nested Objects " in elastic search
body: <p>My requirement is to capture multiple marketplaces for a product in a elastic search.</p>
  
  <p>index : ratingsindextest
  Type : productchild</p>
  
  <p>Each product will be having  multiple market-places and each market-place will have multiple regions and each region will have multiple countries , and i represented this as </p>
  
  <pre><code>{
    "ratingsindextest": {
      "mappings": {
        "productchild": {
          "_routing": {
            "required": true
  
               "productId": {
              "type": "string",
              "index": "not_analyzed"
            },
            "productMarkets": {
              "type": "nested",
              "properties": {
                "lobID": {
                  "type": "string",
                  "index": "not_analyzed"
                },
                "lobValue": {
                  "type": "string",
                  "index": "not_analyzed"
                },
                "regions": {
                  "type": "nested",
                  "properties": {
                    "countries": {
                      "type": "nested",
                      "properties": {
                        "country": {
                          "type": "string",
                          "index": "not_analyzed"
                        },
                        "status": {
                          "type": "string",
                          "index": "not_analyzed"
                        }
                      }
                    },
                    "regionId": {
                      "type": "string",
                      "index": "not_analyzed"
                    },
                    "regionName": {
                      "type": "string",
                      "index": "not_analyzed"
                    }
                  }
                }
              }
            },
            "productName": {
              "type": "string",
              "analyzer": "english"
            },
            "shortDescription": {
              "type": "string",
              "analyzer": "english"
            },
            "supplierId": {
              "type": "string",
              "index": "not_analyzed"
            }
          }
        }
      }
    }
  }
  </code></pre>
  
  <p>and my question is will there be any performance overhead because of multi level nested fields created as above ,  or is it advisable to change the mapping in a way that it accommodates plain list as below</p>
  
  <pre><code>{
    "ratingsindextest": {
      "mappings": {
        "productchild": {
          "_routing": {
            "required": true
          },
          "properties": {
            "productId": {
              "type": "string",
              "index": "not_analyzed"
            },
            "productMarkets": {
              "type": "nested",
              "properties": {
                "lobID": {
                  "type": "string",
                  "index": "not_analyzed"
                },
                "lobValue": {
                  "type": "string",
                  "index": "not_analyzed"
                },
                "region": {
                  "type": "string",
                  "index": "not_analyzed"
                },
                "countryId": {
                  "type": "string",
                  "index": "not_analyzed"
                },
                "countryName": {
                  "type": "string",
                  "index": "not_analyzed"
                }
              }
            },
            "productName": {
              "type": "string",
              "analyzer": "english"
            }
          }
        }
      }
    }
  }
  </code></pre>
  
  <p>the above mentioned way will have multiple nested documents with same Lob but multiple regions and each region having multiple countries .</p>
  
  <p>Any Advice on which approach to follow is appreciated</p>