Some question about duplicate

  1. query with version field

according to elasticsearch document, once a document is modified, filed of 'version' will automatically increased by 1.
question is : how can I get all items which version field is greater than 1, any example dsl statement or document ?

  1. append data to exists field when _id exists

If my data structure is something like this(let's call this log 'log_old'):

{"_id":123, "logs":[{....}, {....}]}

when there is a new item with same id(let's call this new log 'log_new'),I just want something like this


new log's specific field is appended to old log.
I found 'script' keyword, accroding to document's exapmles,I assume 'script' can olny do some mathematical operation(like add some value), or simple string operation(like string splice).
question is:how can I append some data to an array object when item exists ?

Not sure about 1.
But you cannot do 2, if you update a document it'll overwrite the existing array