# Elasticsearch mapping with nested objects

**URL:** <https://discuss.elastic.co/t/elasticsearch-mapping-with-nested-objects/276888>\
**Category:** Elasticsearch\
**Created:** [June 24, 2021, 7:30am UTC](https://discuss.elastic.co/t/elasticsearch-mapping-with-nested-objects/276888 "2021-06-24T07:30:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mskocabay](https://avatars.discourse-cdn.com/v4/letter/m/9dc877/32.png) [@mskocabay](https://discuss.elastic.co/u/mskocabay)\
**Post date:** [June 24, 2021, 7:30am UTC](https://discuss.elastic.co/t/elasticsearch-mapping-with-nested-objects/276888/1 "2021-06-24T07:30:18Z")

</div>

It is my mapping. product\_base is nested object also manufacturer is child of product\_base and nested object. When i create my doc, if product\_base count more than 1 , seems product\_base.0, product\_base.1 . However i couldnt use filter normally. Is my mapping wrong?

Thank you

```auto
$params = 'index' => product,
         'body' => [
            'mappings' => [
               '_source' => [
                  'enabled' => true,
               ],
               'properties' => [
                  'id_product' => ['type' => 'integer'],
                  'id_product_base' => ['type' => 'integer'],
                  

                  'lang' => [
                     'type' => 'nested',
                     'properties' => [
                        'id_product' => ['type' => 'integer'],
                        'id_lang' => ['type' => 'byte'],
                        'name' => ['type' => 'text']
                        

                     ],
                  ],

                  'product_base' => [

                     'type' => 'nested',
                     'properties' => [
                        'id_product_base' => ['type' => 'integer'],
                        'id_manufacturer' => ['type' => 'integer'],
                        'id_product_zone_group' => ['type' => 'text'],
                        'status' => ['type' => 'byte'],

                        'manufacturer' => [

                           'type' => 'nested',
                           'properties' => [
                              'id_manufacturer' => ['type' => 'integer'],
                              'name' => ['type' => 'text'],
                              'status' => ['type' => 'byte'],

                           ],
                        ],

                       ]

                     ]

                  ]

                  ]
                  ]
                  ]
                ];

```

---

<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 22, 2021, 7:30am UTC](https://discuss.elastic.co/t/elasticsearch-mapping-with-nested-objects/276888/2 "2021-07-22T07:30:40Z")

</div>

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