Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Score value is 0 in _explanation with random_score query #10742

Closed
marevol opened this issue Apr 23, 2015 · 1 comment
Closed

Score value is 0 in _explanation with random_score query #10742

marevol opened this issue Apr 23, 2015 · 1 comment
Labels
>bug :Search/Search Search-related issues that do not fall into other categories v1.5.2 v1.6.0 v2.0.0-beta1

Comments

@marevol
Copy link
Contributor

marevol commented Apr 23, 2015

Sending random_score function query with explain=true to Elasticsearch 1.5.1, the value is always 0 in _explanation as below.

...
              {
                 "value": 0,
                 "description": "Math.min of",
                 "details": [
                    {
                       "value": 0,
                       "description": "product of:",
                       "details": [
                          {
                             "value": 0,
                             "description": "random score function (seed: 49)"
                          },
                          {
                             "value": 1,
                             "description": "weight"
                          }
                       ]
                    },
                    {
                       "value": 3.4028235e+38,
                       "description": "maxBoost"
                    }
                 ]
              },
...

I looked into RandomScoreFunction class.
I think that exp.setValue(CombineFunction.toFloat(score(docId, subQueryScore.getValue()))) needs to be call in explainScore method.

@rjernst
Copy link
Member

rjernst commented Apr 23, 2015

I think this was actually fixed today as part of upgrading our lucene snapshot in master:
https://github.com/elastic/elasticsearch/pull/10727/files#diff-8

So this is already fixed in 2.0. I will backport the fix 1.x.

rjernst added a commit that referenced this issue Apr 23, 2015
rjernst added a commit that referenced this issue Apr 23, 2015
@rjernst rjernst closed this as completed Apr 23, 2015
mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015
@clintongormley clintongormley added :Search/Search Search-related issues that do not fall into other categories and removed :Query DSL labels Feb 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Search/Search Search-related issues that do not fall into other categories v1.5.2 v1.6.0 v2.0.0-beta1
Projects
None yet
Development

No branches or pull requests

3 participants