Way to retrieve the nested data using java

Hi all,
I have a nested data in elasticsearch and i need to retrieve it. Can some one tell me the way to do the same. I have tried all the possible way and either I am getting null in the Postman and tried googling as well but not getting any clue. Here is the code

"partydetails": [
                  {
                    "type": "happy",
                    "properties": {
                      "Name": "Rashmi",
                      "Dob": "28-02-1994",
                      "Gender": "female"
                    }
                  },
                 {
                    "type": "sad",
                    "properties": {
                      "Name": "ranchita",
                      "Dob": "28-06-1995",
                      "Gender": "female"
                    }
                  }
                ]

I need to extract the Name from this JSON data using java.
Thanks in advance.

EDIT :- I have got the solution from the below mentioned link and now I am able to access them, but I have one more doubt,

https://stackoverflow.com/questions/33441828/how-to-access-nested-json-in-elasticsearch

Now, after doing this what I feel is, the field values are hardcoded and if anyone will change the mapping/index_name or any other field name then the same code will not work. So, is there some way that we can obtain the same dynamically at run time.

Edit 2:-
@dadoonet Please help me.

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