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
top_children and function_score / script_score don't play nice together #7791
Comments
@synhershko Thanks for opening this. This is a bug also the |
@martijnvg any ETA on a fix for this? |
I've got a possibly similar issue, where the function is improperly run against some results/documents, causing an 'unknown field' error.
|
@synhershko Sorry, I missed your comment... This issue should be resolved by #4081, internally this issue will change the fact that there are multiple mappings per type, so there will be one mapping per index. Right now because in the url your scope has been reduced to the parent type and no other query can therefor in scripting access fields outside of this scope. This restriction should be removed when #4081 is added. The best work around right now is to not define type in the url and do this in the query dsl instead. |
@sandstrom This is because your query runs on an index that simply doesn't have that field and the function_score quest is strict about that. I think the best way to get around this issue is to wrap the function_score query in the |
@martijnvg Doesn't My guess was that |
@sandstrom This depends on what place the filter is defined. If the filter is defined in the query dsl via a Yes, the |
@martijnvg Thanks for confirming my guess, much appreciated! ⛵ I've opened a separate issue to track that: #8638 |
As of 2.0 this now works correctly, eg:
|
Consider the following scenario, executed with 1.3.2:
I get the following error:
Note the
No field found for [score] in mapping with types [pages]
. Meaning, function_score was trying to execute the script_score within the context of the query to pages, instead of against the internal query to tagged-page as I would expect.The text was updated successfully, but these errors were encountered: