# Has\_child script\_field query showing No such property: \_score

**URL:** https://discuss.elastic.co/t/has-child-script-field-query-showing-no-such-property-score/134891
**Category:** Elasticsearch
**Created:** [June 7, 2018, 5:43am UTC](https://discuss.elastic.co/t/has-child-script-field-query-showing-no-such-property-score/134891 "2018-06-07T05:43:34Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![akhilmathew001](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/akhilmathew001/32/77941_2.png) [@akhilmathew001](https://discuss.elastic.co/u/akhilmathew001)
#### Post date: [June 7, 2018, 5:43am UTC](https://discuss.elastic.co/t/has-child-script-field-query-showing-no-such-property-score/134891/1 "2018-06-07T05:43:34Z")

</div>

I was trying to run a script\_field in the has\_child query as follows.  
{  
"query": {  
"has\_child": {  
"type": "applications",  
"inner\_hits": {  
"script\_fields": {  
"parent": {  
"script": {  
"lang": "groovy",  
"file": "application\_sort"  
}  
},  
"child": {  
"script": {  
"lang": "groovy",  
"file": "application\_sort"  
}  
}  
}  
},  
"query": {  
"match\_all": {}  
}  
}  
}  
}

application\_sort is the script file name, which contains the following line,  
return \_score + doc['applied\_date'].value

This query gives error as follows...

"type": "missing\_property\_exception",  
"reason": "No such property: \_score for class: 18642b..

How can I access the \_score in script?

---

<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: [July 5, 2018, 5:43am UTC](https://discuss.elastic.co/t/has-child-script-field-query-showing-no-such-property-score/134891/2 "2018-07-05T05:43:36Z")

</div>

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