-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Script with _score
: remove dependency of DocLookup and scorer
#7819
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
As pointed out in elastic#7487 DocLookup is a variable that is accessible by all scripts for one doc while the query is executed. But the _score and therfore the scorer depends on the current context, that is, which part of query is currently executed. Instead of setting the scorer for DocLookup and have Script access the DocLookup for getting the score, the Scorer should just be explicitely set for each script. DocLookup should not have any reference to a scorer. This was similarly discussed in elastic#7043. This dependency caused a stackoverflow when running script score in combination with an aggregation on _score. Also the wrong scorer was called when nesting several script scores. closes elastic#7487
Just to keep a link of it, adding a comment that this change could help fixing: |
@colings86 @dadoonet I am wondering what to do with 1.3. It is not really broken there, just inconvenient: To use |
LGTM |
brwe
added a commit
that referenced
this pull request
Sep 26, 2014
As pointed out in #7487 DocLookup is a variable that is accessible by all scripts for one doc while the query is executed. But the _score and therfore the scorer depends on the current context, that is, which part of query is currently executed. Instead of setting the scorer for DocLookup and have Script access the DocLookup for getting the score, the Scorer should just be explicitely set for each script. DocLookup should not have any reference to a scorer. This was similarly discussed in #7043. This dependency caused a stackoverflow when running script score in combination with an aggregation on _score. Also the wrong scorer was called when nesting several script scores. closes #7487 closes #7819
brwe
added a commit
that referenced
this pull request
Sep 26, 2014
As pointed out in #7487 DocLookup is a variable that is accessible by all scripts for one doc while the query is executed. But the _score and therfore the scorer depends on the current context, that is, which part of query is currently executed. Instead of setting the scorer for DocLookup and have Script access the DocLookup for getting the score, the Scorer should just be explicitely set for each script. DocLookup should not have any reference to a scorer. This was similarly discussed in #7043. This dependency caused a stackoverflow when running script score in combination with an aggregation on _score. Also the wrong scorer was called when nesting several script scores. closes #7487 closes #7819
clintongormley
changed the title
script with _score: remove dependency of DocLookup and scorer
Scripting: Script with _score: remove dependency of DocLookup and scorer
Sep 26, 2014
brwe
added a commit
to brwe/elasticsearch-lang-python
that referenced
this pull request
Sep 30, 2014
brwe
added a commit
to brwe/elasticsearch-lang-python
that referenced
this pull request
Sep 30, 2014
brwe
added a commit
to elastic/elasticsearch-lang-javascript
that referenced
this pull request
Oct 7, 2014
Due to a change in elasticsearch 1.4.0, we need to apply a similar patch here. See elastic/elasticsearch#6864 See elastic/elasticsearch#7819 Closes #23. (cherry picked from commit 5e5c373)
brwe
added a commit
to elastic/elasticsearch-lang-javascript
that referenced
this pull request
Oct 7, 2014
Due to a change in elasticsearch 1.4.0, we need to apply a similar patch here. See elastic/elasticsearch#6864 See elastic/elasticsearch#7819 Closes #23.
brwe
added a commit
to elastic/elasticsearch-lang-javascript
that referenced
this pull request
Oct 7, 2014
Due to a change in elasticsearch 1.4.0, we need to apply a similar patch here. See elastic/elasticsearch#6864 See elastic/elasticsearch#7819 Closes #23. (cherry picked from commit 5e5c373)
brwe
added a commit
to elastic/elasticsearch-lang-python
that referenced
this pull request
Oct 7, 2014
Due to a change in elasticsearch 1.4.0, we need to apply a similar patch here. See elastic/elasticsearch#6864 See elastic/elasticsearch#7819 Closes #16. Closes #21.
brwe
added a commit
to elastic/elasticsearch-lang-python
that referenced
this pull request
Oct 7, 2014
Due to a change in elasticsearch 1.4.0, we need to apply a similar patch here. See elastic/elasticsearch#6864 See elastic/elasticsearch#7819 Closes #16. Closes #21. (cherry picked from commit cd7756c)
brwe
added a commit
to elastic/elasticsearch-lang-python
that referenced
this pull request
Oct 7, 2014
Due to a change in elasticsearch 1.4.0, we need to apply a similar patch here. See elastic/elasticsearch#6864 See elastic/elasticsearch#7819 Closes #16. Closes #21. (cherry picked from commit cd7756c)
clintongormley
added
the
:Core/Infra/Scripting
Scripting abstractions, Painless, and Mustache
label
Mar 19, 2015
clintongormley
changed the title
Scripting: Script with _score: remove dependency of DocLookup and scorer
Script with Jun 6, 2015
_score
: remove dependency of DocLookup and scorer
mute
pushed a commit
to mute/elasticsearch
that referenced
this pull request
Jul 29, 2015
As pointed out in elastic#7487 DocLookup is a variable that is accessible by all scripts for one doc while the query is executed. But the _score and therfore the scorer depends on the current context, that is, which part of query is currently executed. Instead of setting the scorer for DocLookup and have Script access the DocLookup for getting the score, the Scorer should just be explicitely set for each script. DocLookup should not have any reference to a scorer. This was similarly discussed in elastic#7043. This dependency caused a stackoverflow when running script score in combination with an aggregation on _score. Also the wrong scorer was called when nesting several script scores. closes elastic#7487 closes elastic#7819
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
>breaking
>bug
:Core/Infra/Scripting
Scripting abstractions, Painless, and Mustache
v1.4.0.Beta1
v1.5.0
v2.0.0-beta1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As pointed out in #7487 DocLookup is a variable that is accessible by all scripts
for one doc while the query is executed. But the _score and therfore the scorer
depends on the current context, that is, which part of query is currently executed.
Instead of setting the scorer for DocLookup
and have Script access the DocLookup for getting the score, the Scorer should just
be explicitely set for each script.
DocLookup should not have any reference to a scorer.
This was similarly discussed in #7043.
This dependency caused a stackoverflow when running script score in combination with an
aggregation on _score. Also the wrong scorer was called when nesting several script scores.
closes #7487