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
Elasticsearch inner_hits query results in ArrayOutOfBoundsException #10334
Comments
@mariusdw This is a bug. Elasticsearch mistakes the This error will be fixed, but your mapping design (an object field that has a nested object field) raises a question. Elasticsearch indexes the |
Hi Martijn. Thanks for your reply. The example was just to reproduce the issue that I am experiencing with my real data structure. I kind of modified the example given in the elastic documentation to achieve this and maybe in the process of trying to simplify, used an example that isn't "practical" :) Maybe I should rather explain my real data structure. In our system, we store configuration for various hardware devices. There are two levels of settings that can be configured:
Each configuration server reports these settings (together with some other data) to a central server that stores it as JSON documents in elasticsearch. We then do interesting things like check which percentage of devices that has a certain setting is online etc. As there will only ever be one "group settings" for all devices of a certain type, I have decided to store this as a simple singular object inside my document. The individual settings for each device is then stored inside this single object as nested documents. Looking at your answer I think a simple workaround for me for now would be to change the "group settings" to also be a nested document. |
@mariusdw That decision to use object field makes perfect sense. When PR #10353 gets in inner hits will work again with your mapping. Changing the group settings to nested field will make it work for now, but does increase memory usage (due the fact that you have a nested |
…in object field Closes elastic#10334
Hi! Please have a look at the following. Elastic is throwing an ArrayOutOfBoundsException when requesting inner_hits in my search query. The query works fine if inner_hits is not included. I feel this is a bug in elasticsearch. To reproduce:
Should the document not have been returned with the "Nice website" comment in the inner_hits array?
The text was updated successfully, but these errors were encountered: