# Random\_score always returns 0

**URL:** <https://discuss.elastic.co/t/random-score-always-returns-0/21562>\
**Category:** Elasticsearch\
**Created:** [January 9, 2015, 4:49pm UTC](https://discuss.elastic.co/t/random-score-always-returns-0/21562 "2015-01-09T16:49:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Max\_Schumacher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/max_schumacher/32/1005_2.png) [@Max\_Schumacher](https://discuss.elastic.co/u/Max_Schumacher)\
**Post date:** [January 9, 2015, 4:49pm UTC](https://discuss.elastic.co/t/random-score-always-returns-0/21562/1 "2015-01-09T16:49:51Z")

</div>

Hi,  
I was having problems combining random\_score with other scoring functions,  
until I noticed using the "explain" feature that apparently random\_score  
always returns 0, no matter the seed or document.  
Here is some more info:

```
    "query": {

```

> ```
> "function_score": {
> 
> "functions": [
> 
> {
> 
> "random_score" : {
> 
> }
> 
> }
> 
> ]
> 
> }
> 
> }
> 
> ```

Explain always gives this for the random\_score function:

> {"value":0.0,"description":"random score function (seed: -830865530)"}

I've tried many variations and different seeds, but the result is always  
the same.  
Could someone enlighten me as to what's happening, or help me debug this  
further?

Thanks!  
Max

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/7a310c77-7374-4ba8-88a5-409de9d321de%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/7a310c77-7374-4ba8-88a5-409de9d321de%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 6, 2017, 12:39am UTC](https://discuss.elastic.co/t/random-score-always-returns-0/21562/2 "2017-07-06T00:39:49Z")

</div>


