-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
function_score/script_score query not returning scored results #220
Comments
I am afraid this is not an issue with the python client - it works fine with normal search (no
And then
it behaves the same. Looks like in search type scan the function score doesn't apply correctly. Since this is not documented with elasticsearch I would consider it a bug there - either it should work or it should be properly documented that it doesn't. I will consult the elasticsearch developers and open a ticket there if it's indeed the case. Thanks for the thorough report! |
Actually I forgot that |
Yep, that is in fact the problem. I have no trouble doing custom scoring with just a regular scroll-id and passing it on to ES through the rawes client. Just a shame it's such a low-level client... Thanks for your help and for reporting the issue. I was starting to feel weird when I saw nobody having my problem XD |
You can do the same - just ask for scroll and pass it to scroll through this client. Alternatively (I just learned) you can also add a
|
Hi guys, I've stumbled upon this issue and it seems to be a problem of the client... It might be a bit counter-intuitive but I'm fairly at ease with stating this because the issue is not present when I run the same query through a different client.
I'm currently trying to query ES through Python, using elasticsearch-py but with no success... I'm testing the request on the "elasticsearch-head" plugin and it works fine (results come scored). Also using the rawes client reveals no issues with the query.
However, when I do it in elasticsearch-py something seems to be wrong and although I get the same results, they are not scored properly...
here is the code:
This is my custom query, very simple, just to test the scoring mechanism.
now I test it out:
All this gives is a set of results that have been improperly scored... I've even enabled "_explanation" to understand if the script is being utilized...
This meaning:
So, at least from the explanation, scoring seems appropriate but "_score" is not getting changed.
I really don't want to switch to rawes because of the helpers allowing me to scroll through the set of results with fair ease. Could this be an issue with "scroll"? Should I use "scan" instead and set "preserve_order" to True? I've half-tried it with no positive outcome...
Thanks a lot in advance,
Bernardo
The text was updated successfully, but these errors were encountered: