2

Is there a way in ElasticSearch wherein I can remove some the objects in the nested field array.

So I have a nested field and it returns array of objects. I need to remove some objects in the nested field.

Is it possible to do so in the query or I need to do that in my code

Nipun
  • 4,119
  • 5
  • 47
  • 83

2 Answers2

2

These extra nested documents are hidden; we can’t access them directly. To update, add, or remove a nested object, we have to reindex the whole document. It’s important to note that, the result returned by a search request is not the nested object alone; it is the whole document.

Nested Objects Elastic search

user157015
  • 31
  • 2
0

As far as I know, In Elasticsearch you can't just remove part of a existing document. You should change the document (remove objects you don't need) and renew(rewrite) the document.

Dmitry Lovermann
  • 260
  • 1
  • 5
  • 13