Accessing inline fields of es json response

Hi All,

I am new to Elasticsearch, could any one please help me on getting the value of a particular of below format,

"_source": {
"Identification": {
"PAYL_HDR": {
"DUNS_NBR": "12345678",
"GEO_REF_ID": "34567",
"GSRL_DT": "2017-08-22T15:24:46.000000",
"INFO_SRC_CD": 20008,
"REC_TYP_CD": 11592
},

Above provided piece of json is from elasticsearch response. through script fields functionality i have to get INFO_SRC_CD and REC_TYP_CD values. when i am trying to do in below way,

{
"script_fields" : {
"test1" : {
"script" : {
"lang": "painless",
"source": "doc['Identification.PAYL_HDR.INFO_SRC_CD'].value + doc['Identification.PAYL_HDR.REC_TYP_CD'].value"
}
}
}
}

I am getting below error,
Error:
Fielddata is disabled on text fields by default. Set fielddata=true on [Identification.PAYL_HDR.INFO_SRC_CD] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead.

Could you please help me out on how to solve this issue.

Thanks,
Prasad

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