Update (merge document) Elasticsearch 5.0 -




i have document update in elastic bulk. in document have field dictionary , list.

how merge them?

also need update query.

for example:

source of document index:

{     "simple_field": "",     "dict_field": { "key": "value" },     "complex_field": {         "list_field": ["value"],         "dict_field1": {             "list_field2": [                 {                     "key": "val",                     "key1": "val2",                     "key2": "val"                 }             ]         }     } } 

partial doc update:

{     "dict_field": {         "key2":"value"     }     "complex_field": {         "list_field": [             "value2"         ],         "dict_field1": {             "list_field2": [                 {                     "key": "val",                     "key1": "val2",                     "key2": "val1"  #this value must update                 },                 {                     "key": "val3",                     "key1": "val2",                     "key2": "val111"                 }   #this field must add             ],             "simple_value": true #this field must add without overwrite other fields         }     } } 

i want result:

{     "_source": {         "simple_field": "",         "dict_field": {             "key": "value",             "key2": "value"         },         "complex_field": {             "list_field": [                 "value",                 "value2"             ],             "dict_field1": {                 "list_field2": [                     {                         "key": "val",                         "key1": "val2",                         "key2": "val1"                     },                     {                         "key": "val3",                         "key1": "val2",                         "key2": "val111"                     }                 ],                 "simple_value": true             }         }     } } 





wiki

Comments

Popular posts from this blog

elasticsearch - what is the equivalent data type for geo_point in hibernate search? -

Jenkins: find build number for git commit -

firebase - How to wait value in Ionic 2 -