I know that Elasticsearch supports object and nested field type. According to my understanding they represent an individual object and an array of objects respectively. However, is it possible to have a field which is a hash-map of objects?
My use case is as follows –
- I want to be able to find a target object
- Modify only that target object
- Update that change in the Elasticsearch index
Currently, I am using the nested field type. The problem with that is for finding the target object I am having to loop through the entire array, make the change and then re-index. This will become expensive as my field starts having more and more objects
I know that I can do an _update_by_query
using ctx but even that seems to loop through the field to find the target object.
Is there something that I am missing.
PS – I am a beginner in Elasticsearch