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
Scripting: ScriptDocValues.getValues() returns an reused list #8576
Comments
Aah, clearly the "problem" is that |
@dw I tried to reproduce your issue without success. Here is what I ran:
which returned
Can you maybe guide me a bit so that I can reproduce the issue? I used a fresh install of elasticsearch 1.4.0. |
@jpountz huh strange. How many shards does your index have? If >1 and both docs went to a different shard, and the script_value is executed in the context of a shard, that might explain why you don't see it |
(I've only been using ElasticSearch a week, so still guessing about things quite heavily) |
Ah, doh, sorry, didn't notice you'd set the shards to 1. Hmm, not sure |
OK I found the reason: this bug only occurs on a per-segment basis, so you need to run an optimize to reproduce the bug. Here is a recreation for the bug:
which returns
|
Scripts currently share the same list across invocations to getValues. This caused a bug in script fields where all documents coming from the same segment would get the same values (basically, for the next document for which script values have been requested). Scripts now return a fresh new list on every invocation to `getValues`. Close elastic#8576
Scripts currently share the same list across invocations to getValues. This caused a bug in script fields where all documents coming from the same segment would get the same values (basically, for the next document for which script values have been requested). Scripts now return a fresh new list on every invocation to `getValues`. Close #8576
Scripts currently share the same list across invocations to getValues. This caused a bug in script fields where all documents coming from the same segment would get the same values (basically, for the next document for which script values have been requested). Scripts now return a fresh new list on every invocation to `getValues`. Close #8576
Scripts currently share the same list across invocations to getValues. This caused a bug in script fields where all documents coming from the same segment would get the same values (basically, for the next document for which script values have been requested). Scripts now return a fresh new list on every invocation to `getValues`. Close elastic#8576
Using ElasticSearch 1.4.0 from your official .deb, given an index with:
And:
A search like:
Will return a result set whose hits contain an
artist
array whose elements correspond to the elements for the last search result, i.e. all previous hitsartist
arrays assume the same contents as that of the last hit. It looks like an object is being reused somehow, although casting a glance at ScriptDocValues.java I can't see how. Is it possiblelistLoaded
is not being reset somehow?A trivial workaround is:
The text was updated successfully, but these errors were encountered: