Mapping with nested data

Hi Everyone,
I have some nested data. I want to perform the mapping on this data but I am not able to get the correct mapping.
I have data like that:

Data:
POST /icd10cmindex/icd10/1
{
"version": "2018",
"title": "ICD-10-CM INDEX TO DISEASES and INJURIES",
"letter": [
{
"title": "A",
"mainTerm": [
{
"title": "Aarskog's syndrome",
"code": "Q87.1"
},
{
"title": "Abandonment",
"see": "Maltreatment"
},
{
"title": {
"#text": "Abasia",
"nemod": "(-astasia) (hysterical)"
},
"code": "F44.4"
},
{
"title": {
"#text": "Abderhalden-Kaufmann-Lignac syndrome",
"nemod": "(cystinosis)"
},
"code": "E72.04"
},
{
"title": "Abdomen, abdominal",
"seeAlso": "condition",
"term": [
{
"-level": "1",
"title": "acute",
"code": "R10.0"
},
{
"-level": "1",
"title": "angina",
"code": "K55.1"
},
{
"-level": "1",
"title": "muscle deficiency syndrome",
"code": "Q79.4"
}
]
}
]
}
]
}

I am applying the mapping like that:
Mapping:
PUT /icd10cmindex
{
"mappings" : {
"icd10" : {
"properties" : {
"version": {
"type": "string"
},
"title":{
"type":"string"
},
"letter": {
"type": "nested",
"properties": {
"title": {
"type": "string"
},
"mainTerm": {
"type": "nested",
"properties": {
"code": {
"type": "string"
},
"see": {
"type": "string"
},
"title": {
"type": "string"
},
"term": {
"type": "nested",
"properties": {
"-level": {
"type": "long"
},
"title": {
"type": "string"
},
"code": {
"type": "string"
}
}
}
}
}
}
}
}
}
}
}

Actually the problem is when I am applying the query then I am not able to get the title field data.so provide me the correct mapping for this data.

@abhishek5678 This seem to be a duplicate of Problem with Nested Data Inside the Objects Data.

Please keep the discussion around a single issue to a single thread.

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