# Accessing inline fields of es json response

**URL:** <https://discuss.elastic.co/t/accessing-inline-fields-of-es-json-response/127612>\
**Category:** Elasticsearch\
**Created:** [April 11, 2018, 10:43am UTC](https://discuss.elastic.co/t/accessing-inline-fields-of-es-json-response/127612 "2018-04-11T10:43:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![prasad.ram1431](https://avatars.discourse-cdn.com/v4/letter/p/c89c15/32.png) [@prasad.ram1431](https://discuss.elastic.co/u/prasad.ram1431)\
**Post date:** [April 11, 2018, 10:43am UTC](https://discuss.elastic.co/t/accessing-inline-fields-of-es-json-response/127612/1 "2018-04-11T10:43:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 9, 2018, 10:44am UTC](https://discuss.elastic.co/t/accessing-inline-fields-of-es-json-response/127612/2 "2018-05-09T10:44:11Z")

</div>

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