# Self implemented versioning: return only top versions

**URL:** <https://discuss.elastic.co/t/self-implemented-versioning-return-only-top-versions/48569>\
**Category:** Elasticsearch\
**Created:** [April 27, 2016, 3:14pm UTC](https://discuss.elastic.co/t/self-implemented-versioning-return-only-top-versions/48569 "2016-04-27T15:14:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andreas\_Turowski](https://avatars.discourse-cdn.com/v4/letter/a/3ec8ea/32.png) [@Andreas\_Turowski](https://discuss.elastic.co/u/Andreas_Turowski)\
**Post date:** [April 27, 2016, 3:14pm UTC](https://discuss.elastic.co/t/self-implemented-versioning-return-only-top-versions/48569/1 "2016-04-27T15:14:17Z")

</div>

We don't use elastics version feature, because every document in a version strain has a different id. But they have the same "RootId" - field value, if they belong to the same strain. There is another Field named "Version". Is there any way to get only the documents with the highest "Version" in the same RootId. We use queryString-Queries. I hope you can help me !

---

<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:55pm UTC](https://discuss.elastic.co/t/self-implemented-versioning-return-only-top-versions/48569/2 "2017-07-05T22:55:55Z")

</div>


