-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
getting sort field via script_fields results in array_index_out_of_bounds_exception for some values #99620
Comments
Pinging @elastic/es-search (Team:Search) |
This also affects the |
…pers (#99361) We mostly have a handful of `FieldType` values here across all mappers and none of them contain attributes. There's only so many combinations here, lets deduplicate these to save some heap and set up subsequent mapper heap savings.
Pinging @elastic/es-search-foundations (Team:Search Foundations) |
Hey @juntezhang sorry for the lag. Looking at your recreation, I wonder what the purpose of the script is. Can you just retrieve the field without a script? Perhaps I am missing something. Besides that, given that the behaviour you are observing is field type dependent, perhaps analysis chain dependent, it seems like some tokens are removed as part of text analysis. Could this be fixed by making your script more robust, by first checking that there are values for the field before retrieving them? |
Closing for lack of feedback. Feel free to post more info and we will reopen as needed. |
Elasticsearch Version
8.9.2
Installed Plugins
analysis-icu
Java Version
bundled
OS Version
as shipped in docker.elastic.co/elasticsearch/elasticsearch:8.9.2; Linux kernel 6.4
Problem Description
Getting the sort value of some simple text values (such as "Q" or "W") in a painless script results in an
array_index_out_of_bounds_exception
while the same request has no issues with other values such as "A" or "QQ".Seems to work fine on ES 7.17, but is also broken on ES 8.5.
analysis-icu
plugin is required to reproduce the problem.Steps to Reproduce
The following script creates a simple index, adds two objects and searches for these objects with
script_fields
. For the first object, it works fine, for the second object, an error is returned:Result for the first object, no problem:
Result for the second object, the error:
Logs (if relevant)
No response
The text was updated successfully, but these errors were encountered: