Removing objects from nested fields in ElasticSearch

[亡魂溺海] 提交于 2021-01-29 02:10:20

问题


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


回答1:


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




回答2:


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.



来源:https://stackoverflow.com/questions/38739683/removing-objects-from-nested-fields-in-elasticsearch

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!