# Re-Index does not delete missing nested objects

**URL:** <https://discuss.elastic.co/t/re-index-does-not-delete-missing-nested-objects/176248>\
**Category:** Elasticsearch\
**Created:** [April 10, 2019, 2:58pm UTC](https://discuss.elastic.co/t/re-index-does-not-delete-missing-nested-objects/176248 "2019-04-10T14:58:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![creaticious](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/creaticious/32/24784_2.png) [@creaticious](https://discuss.elastic.co/u/creaticious)\
**Post date:** [April 10, 2019, 2:58pm UTC](https://discuss.elastic.co/t/re-index-does-not-delete-missing-nested-objects/176248/1 "2019-04-10T14:58:05Z")

</div>

Hey guys,

we have an product index with a nested field "dates". Let's say we put a product in it by:

```auto
PUT products/basics/1
{
    "sku" : "12345",
    "title" : "test product",
    "image" : "test_high.jpg",
    "productmanager": "none",
    "dates":[
      {
        "date-origin": "01.01.2018",
        "date-destination": "10.01.2018",
        "instock": 1
      },
      {
        "date-origin": "20.01.2018",
        "date-destination": "30.01.2018",
        "instock": 0
      }
    ]
}

```

Now if we want to update it by doing this again with changed values and one missing nested object...like:

```auto
PUT products/basics/1
{
    "sku" : "12345",
    "title" : "test product new",
    "image" : "test_high_new.jpg",
    "productmanager": "someone",
    "dates":[
      {
        "date-origin": "01.01.2018",
        "date-destination": "10.01.2018",
        "instock": 1
      }
    ]
}

```

...the second object in "dates" will not be deleted...

How could i tell ES to delete the missing nested objects when updating the document?

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:** [May 8, 2019, 2:58pm UTC](https://discuss.elastic.co/t/re-index-does-not-delete-missing-nested-objects/176248/2 "2019-05-08T14:58:15Z")

</div>

Closed on May 8, 2019, 2:58pm UTC

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