Consider a document in Elasticsearch as follows:
{ "id": 1, "Comment": "Comment text", "Reply": [{ "id": 2, "Comment": "Nested comment text", }, { "id": 3, "Comment": "Another nested comment text", }] }
I want to find id == 2 , not knowing if it is on the first level of the document or in the second. Is it possible? Also keep in mind that anything can be a nested level (unknown at design time).
If this is possible, then what query returns this document by searching id == 2 , not knowing that there is id on the second level of the document?
source share