There are 2 questions on elasticsearch
- Faced with complexity when changing a document in elasticsearch.
Document structure:
{ service:{ name: name, date: [{time:time, log: log}] } }
It is necessary to add one more array element to the "date" object. Did this:
curl -XPOST 'localhost:9200/_index/_doc/_id/_update' -d '{ "script": "ctx._source.service += new_date", "params": { "new_date": {"date": [ {"time": "time_new", "log": "log_new"} ]} } }'
As a result, I get:
{ service:{ name: name, date: [{time:time, log: log}] date: [{time:time_new, log: log_new}] } }
And I would like to:
{ service:{ name: name, date: [{time:time, log: log}, {time:time_new, log: log_new}] } }
Can this be done somehow more carefully, not to create another object?
- The second question is tied to the first, how can this be done through python
( API Documentation - Elasticsearch ).
Just starting to deal with this system, do not kick much :-)
Thanks in advance for your help!