Better way to convert the object field to nested type field

Hi Team

We have an index with object field, we are planning to improve the object field into nested type (array of objects).

ie.

{
"name": "Adam",
"car" : {
"name": "Maruthi",
"modelyear": "2005"
}
}

we are trying to store the documents from the above one to below one

{
"name": "ABC",
"car" : [
{
"name": "Maruthi",
"modelyear": "2005"
},
{
"name": "HONDA",
"modelyear": "2008"
}
}

My Question is

  1. if I do the search query with car.name="Maruthi" will return both documents? or one with nested type will return.

  2. what should be the better way to update the existing index mapping? I see articles saying elastic will not support updating the existing index mapping.

My elastic server version is 6.8.5.

Team, any suggestions or any feedback on the question.

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