# How to access max\_score from function score logic?

**URL:** https://discuss.elastic.co/t/how-to-access-max-score-from-function-score-logic/135310
**Category:** Elasticsearch
**Created:** [June 11, 2018, 8:30am UTC](https://discuss.elastic.co/t/how-to-access-max-score-from-function-score-logic/135310 "2018-06-11T08:30:36Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Dhiwakar\_Kusuma](https://avatars.discourse-cdn.com/v4/letter/d/779978/32.png) [@Dhiwakar\_Kusuma](https://discuss.elastic.co/u/Dhiwakar_Kusuma)
#### Post date: [June 11, 2018, 8:30am UTC](https://discuss.elastic.co/t/how-to-access-max-score-from-function-score-logic/135310/1 "2018-06-11T08:30:36Z")

</div>

Is there a way to access max\_score ... I'm trying to do something like below.

GET my\_index/\_search  
{  
"query": {  
"function\_score": {  
.....  
}  
},  
"script\_score": {  
"script": {  
"lang": "expression",  
"source": "\_score / max\_score \* 20"  
}  
}  
}  
}  
}

---

<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 9, 2018, 8:30am UTC](https://discuss.elastic.co/t/how-to-access-max-score-from-function-score-logic/135310/2 "2018-07-09T08:30:41Z")

</div>

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