# How can I disable versioning?

**URL:** <https://discuss.elastic.co/t/how-can-i-disable-versioning/9422>\
**Category:** Elasticsearch\
**Created:** [October 19, 2012, 1:59pm UTC](https://discuss.elastic.co/t/how-can-i-disable-versioning/9422 "2012-10-19T13:59:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cailin\_Nelson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cailin_nelson/32/2673_2.png) [@Cailin\_Nelson](https://discuss.elastic.co/u/Cailin_Nelson)\
**Post date:** [October 19, 2012, 1:59pm UTC](https://discuss.elastic.co/t/how-can-i-disable-versioning/9422/1 "2012-10-19T13:59:17Z")

</div>

Our index size seems to grow and grow over time. I assume this is due to  
versioning. I don't care about having multiple versions of a document.  
How can I just turn it off?

--

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [October 19, 2012, 2:05pm UTC](https://discuss.elastic.co/t/how-can-i-disable-versioning/9422/2 "2012-10-19T14:05:24Z")

</div>

In fact, ES doesn't store multiple version of docs but use a version number for  
optional concurrency control. See  
[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/index_.html)  
[http://www.elasticsearch.org/guide/reference/api/index\_.html](http://www.elasticsearch.org/guide/reference/api/index_.html)

That said, you can call Optimize API to optimize your index. See :  
[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-optimize.html)  
[http://www.elasticsearch.org/guide/reference/api/admin-indices-optimize.html](http://www.elasticsearch.org/guide/reference/api/admin-indices-optimize.html)

Are you creating and deleting many documents?

HTH  
David

Le 19 octobre 2012 à 15:59, Cailin Nelson [cailin@turntable.fm](mailto:cailin@turntable.fm) a écrit :

> Our index size seems to grow and grow over time. I assume this is due to  
> versioning. I don't care about having multiple versions of a document. How  
> can I just turn it off?
> 
> --

--  
David Pilato  
[http://www.scrutmydocs.org/](http://www.scrutmydocs.org/)  
[http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

--

---

<div class="post-metadata">

**Author:** ![Cailin\_Nelson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cailin_nelson/32/2673_2.png) [@Cailin\_Nelson](https://discuss.elastic.co/u/Cailin_Nelson)\
**Post date:** [October 19, 2012, 2:31pm UTC](https://discuss.elastic.co/t/how-can-i-disable-versioning/9422/3 "2012-10-19T14:31:56Z")

</div>

Ah - thanks for the clarification.

Our rough numbers are something like the following:

- 20 million docs
- 500,000 re-indexes per day
- 10,000 deletes per day (but occasionally up to 1 million)
- 10,000 new docs per day

Is the optimize API something I should be working in to our regular process?

--

---

<div class="post-metadata">

**Author:** ![phill](https://avatars.discourse-cdn.com/v4/letter/p/779978/32.png) [@phill](https://discuss.elastic.co/u/phill)\
**Post date:** [October 19, 2012, 7:53pm UTC](https://discuss.elastic.co/t/how-can-i-disable-versioning/9422/4 "2012-10-19T19:53:49Z")

</div>

I understand the "modern way" to do that is not to optimize, but to  
modify the merge policy which is used to automatically combine the  
low-level Lucene segments as needed. The values that trigger a merge  
and how to re-merge are all defined by the merge policy.

I too was all worried about optimize until I saw the merge policy kick  
in and clean things up. What you want is for deleted documents to  
end up in segments that are small enough to likely eventually either  
completely disappear or get merged together with others thus dropping  
the deletes and even elimating whole segment files, but with some  
balance between too many segments, and no segments that ever get merged  
together.

-Paul

On 10/19/2012 7:31 AM, Cailin Nelson wrote:

> Ah - thanks for the clarification.
> 
> Our rough numbers are something like the following:
> 
> - 20 million docs
> - 500,000 re-indexes per day
> - 10,000 deletes per day (but occasionally up to 1 million)
> - 10,000 new docs per day
> 
> ## Is the optimize API something I should be working in to our regular process?

--

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [October 20, 2012, 10:40pm UTC](https://discuss.elastic.co/t/how-can-i-disable-versioning/9422/5 "2012-10-20T22:40:11Z")

</div>

As Paul said, there is a background merge process running all the time, with reasonable defaults, so you don't need to run the optimize API in a scheduled manner at all.

On Oct 19, 2012, at 9:56 PM, P. Hill [parehill1@gmail.com](mailto:parehill1@gmail.com) wrote:

> I understand the "modern way" to do that is not to optimize, but to modify the merge policy which is used to automatically combine the low-level Lucene segments as needed. The values that trigger a merge and how to re-merge are all defined by the merge policy.
> 
> I too was all worried about optimize until I saw the merge policy kick in and clean things up. What you want is for deleted documents to end up in segments that are small enough to likely eventually either completely disappear or get merged together with others thus dropping the deletes and even elimating whole segment files, but with some balance between too many segments, and no segments that ever get merged together.
> 
> -Paul
> 
> On 10/19/2012 7:31 AM, Cailin Nelson wrote:
> 
> > Ah - thanks for the clarification.
> > 
> > Our rough numbers are something like the following:
> > 
> > - 20 million docs
> > - 500,000 re-indexes per day
> > - 10,000 deletes per day (but occasionally up to 1 million)
> > - 10,000 new docs per day
> > 
> > ## Is the optimize API something I should be working in to our regular process?
> 
> --

--

---

<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, 3:07am UTC](https://discuss.elastic.co/t/how-can-i-disable-versioning/9422/6 "2017-07-06T03:07:49Z")

</div>


