Updating a field with a nested array in Elastic Search Updating a field with a nested array in Elastic Search arrays arrays

Updating a field with a nested array in Elastic Search


The message "Can't get text on a START_OBJECT" means that Elasticsearch was expecting an entry of type "string" but you are trying to give an object as input.

If you check Kibana you will find that the field "products" exists there and is defined as a string. But since you are entering a list of dictionaries then the field "products" should have been defined from the beginning as an object (preferably with dynamic fields in it). An example would be (see full example at https://www.elastic.co/guide/en/elasticsearch/reference/current/dynamic.html )

    "products": {       "dynamic": true,      "properties": {}    }

However since you already have the index then you can't change the mapping so you would need to delete the index, do the mapping beforehand and then do the update.