# Is it possible to either query or filter for value of \_version?

**URL:** <https://discuss.elastic.co/t/is-it-possible-to-either-query-or-filter-for-value-of--version/1337>\
**Category:** Elasticsearch\
**Created:** [May 26, 2015, 6:18pm UTC](https://discuss.elastic.co/t/is-it-possible-to-either-query-or-filter-for-value-of--version/1337 "2015-05-26T18:18:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Douglas\_McQuilken](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/douglas_mcquilken/32/44897_2.png) [@Douglas\_McQuilken](https://discuss.elastic.co/u/Douglas_McQuilken)\
**Post date:** [May 26, 2015, 6:18pm UTC](https://discuss.elastic.co/t/is-it-possible-to-either-query-or-filter-for-value-of--version/1337/1 "2015-05-26T18:18:51Z")

</div>

After indexing I'm interested in selecting just the new documents.  
THX

---

<div class="post-metadata">

**Author:** ![Ron\_Kass](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ron_kass/32/20427_2.png) [@Ron\_Kass](https://discuss.elastic.co/u/Ron_Kass)\
**Post date:** [May 26, 2015, 6:28pm UTC](https://discuss.elastic.co/t/is-it-possible-to-either-query-or-filter-for-value-of--version/1337/2 "2015-05-26T18:28:04Z")

</div>

What do you mean by "new documents"?  
If you mean documents you indexed "recently", then it is not \_version you are looking for, but some "timestamp" you need to attach to each document when it is added.  
\_version is the internal versioning of each document, which increases once it is overwritten (in case of updates for example). However, Elastic doesn't store the "older" versions of a document. Only the latest "\_version" exist.

---

<div class="post-metadata">

**Author:** ![Douglas\_McQuilken](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/douglas_mcquilken/32/44897_2.png) [@Douglas\_McQuilken](https://discuss.elastic.co/u/Douglas_McQuilken)\
**Post date:** [May 26, 2015, 7:06pm UTC](https://discuss.elastic.co/t/is-it-possible-to-either-query-or-filter-for-value-of--version/1337/3 "2015-05-26T19:06:26Z")

</div>

Ron et al, I'll be doing a series of indexing operations which consist of  
existing (as far as elastic search is concerned) and new. Timestamps aren't  
really going to work - for this query/filter I just want \_version =1 not  
"recent" documents. I realize that I could obtain this information during  
indexing ("created": true) but this is a bit more awkward. Thx for your  
assistance!

Doug McQuilken  
President  
[http://www.growthroughpeople.com/](http://www.growthroughpeople.com/)  
Mentor  
[https://charlestonsc.score.org/](https://charlestonsc.score.org/)  
Amateur Shipwright  
[http://dougmcq000.wix.com/valiant](http://dougmcq000.wix.com/valiant)  
Moderator  
[https://groups.yahoo.com/neo/groups/Charleston-Wooden-Boats/info](https://groups.yahoo.com/neo/groups/Charleston-Wooden-Boats/info)

---

<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 6, 2017, 12:11am UTC](https://discuss.elastic.co/t/is-it-possible-to-either-query-or-filter-for-value-of--version/1337/4 "2017-07-06T00:11:49Z")

</div>


