# Some question about duplicate

**URL:** <https://discuss.elastic.co/t/some-question-about-duplicate/48412>\
**Category:** Elasticsearch\
**Created:** [April 26, 2016, 10:32am UTC](https://discuss.elastic.co/t/some-question-about-duplicate/48412 "2016-04-26T10:32:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hacksign](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hacksign/32/5918_2.png) [@Hacksign](https://discuss.elastic.co/u/Hacksign)\
**Post date:** [April 26, 2016, 10:32am UTC](https://discuss.elastic.co/t/some-question-about-duplicate/48412/1 "2016-04-26T10:32:44Z")

</div>

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
> 
> > log\_old.logs.append(log\_new.logs)
> 
> 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 ?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [April 27, 2016, 6:17am UTC](https://discuss.elastic.co/t/some-question-about-duplicate/48412/2 "2016-04-27T06:17:14Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 10:56pm UTC](https://discuss.elastic.co/t/some-question-about-duplicate/48412/3 "2017-07-05T22:56:06Z")

</div>

Closed on July 5, 2017, 10:56pm UTC


