# Document versioning

**URL:** <https://discuss.elastic.co/t/document-versioning/16279>\
**Category:** Elasticsearch\
**Created:** [March 11, 2014, 7:47am UTC](https://discuss.elastic.co/t/document-versioning/16279 "2014-03-11T07:47:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arik\_Gaisler](https://avatars.discourse-cdn.com/v4/letter/a/6f9a4e/32.png) [@Arik\_Gaisler](https://discuss.elastic.co/u/Arik_Gaisler)\
**Post date:** [March 11, 2014, 7:47am UTC](https://discuss.elastic.co/t/document-versioning/16279/1 "2014-03-11T07:47:51Z")

</div>

Hi

Is there a way to retreieve a certain version of a document when fetching  
the document?  
Also - for how long are the old versions retained? Is this something  
controllable/configurable?

Arik

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/ff3891c9-931b-4439-bd7e-e3d6280b4a4a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/ff3891c9-931b-4439-bd7e-e3d6280b4a4a%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Boaz\_Leskes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/boaz_leskes/32/723_2.png) [@Boaz\_Leskes](https://discuss.elastic.co/u/Boaz_Leskes)\
**Post date:** [March 11, 2014, 11:57am UTC](https://discuss.elastic.co/t/document-versioning/16279/2 "2014-03-11T11:57:13Z")

</div>

Hi Arik,  
Elasticsearch only stores the latest version of every document. You can  
verify that the version you retrieve is the one you expect (useful for  
optimistic locking) but you can't get previous versions.

Cheers,  
Boaz

On Tuesday, March 11, 2014 8:47:51 AM UTC+1, Arik Gaisler wrote:

> Hi
> 
> Is there a way to retreieve a certain version of a document when fetching  
> the document?  
> Also - for how long are the old versions retained? Is this something  
> controllable/configurable?
> 
> Arik

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/1a061c79-a63f-4299-827b-8c8b1fd19c85%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/1a061c79-a63f-4299-827b-8c8b1fd19c85%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Arik\_Gaisler](https://avatars.discourse-cdn.com/v4/letter/a/6f9a4e/32.png) [@Arik\_Gaisler](https://discuss.elastic.co/u/Arik_Gaisler)\
**Post date:** [March 11, 2014, 1:05pm UTC](https://discuss.elastic.co/t/document-versioning/16279/3 "2014-03-11T13:05:26Z")

</div>

Thanks Boaz

On Tuesday, March 11, 2014 1:57:13 PM UTC+2, Boaz Leskes wrote:

> Hi Arik,  
> Elasticsearch only stores the latest version of every document. You can  
> verify that the version you retrieve is the one you expect (useful for  
> optimistic locking) but you can't get previous versions.
> 
> Cheers,  
> Boaz
> 
> On Tuesday, March 11, 2014 8:47:51 AM UTC+1, Arik Gaisler wrote:
> 
> > Hi
> > 
> > Is there a way to retreieve a certain version of a document when fetching  
> > the document?  
> > Also - for how long are the old versions retained? Is this something  
> > controllable/configurable?
> > 
> > Arik

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/0a521eee-763e-45c2-af0b-3100f52aa575%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0a521eee-763e-45c2-af0b-3100f52aa575%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:44am UTC](https://discuss.elastic.co/t/document-versioning/16279/4 "2017-07-06T01:44:12Z")

</div>


