# ElasticSearch(0.90) How to make big segment at first place

**URL:** <https://discuss.elastic.co/t/elasticsearch-0-90-how-to-make-big-segment-at-first-place/13050>\
**Category:** Elasticsearch\
**Created:** [August 3, 2013, 1:59am UTC](https://discuss.elastic.co/t/elasticsearch-0-90-how-to-make-big-segment-at-first-place/13050 "2013-08-03T01:59:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prakash\_Patidar](https://avatars.discourse-cdn.com/v4/letter/p/edb3f5/32.png) [@Prakash\_Patidar](https://discuss.elastic.co/u/Prakash_Patidar)\
**Post date:** [August 3, 2013, 1:59am UTC](https://discuss.elastic.co/t/elasticsearch-0-90-how-to-make-big-segment-at-first-place/13050/1 "2013-08-03T01:59:30Z")

</div>

Hi,  
We are using ElasticSearch(ES) to index large number of documents every day.  
By default , ElasticSearch(Lucene) is creating smaller segments and it's  
background threads makes them bigger based on merging policy.  
To reduce merge cycles and have efficient segment at first place , i would  
like ES to create bigger segment in memory and writes to disk(no probs if  
it uses more memory and searches are available only after it flushes  
segments to disk).  
I knew Older version of Lucene 3.0 had setting \*setMaxBufferedDocs[http://lucene.apache.org/core/2\_9\_4/api/all/org/apache/lucene/index/IndexWriter.html#setMaxBufferedDocs(int)](http://lucene.apache.org/core/2_9_4/api/all/org/apache/lucene/index/IndexWriter.html#setMaxBufferedDocs(int))  
(\*Determines the minimal number of documents required before the buffered  
in-memory documents are flushed as a new Segment).

Can I do the same in ES where creating bigger segments(may be 100 MB or  
bigger ) and reduce merge cycles(max 1 merge or will avoid merge and run  
force merge at the end of day , as i am creating new index every day) to  
reduce IO substantially.

Regards,  
Prakash

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![simonw\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simonw_2/32/1130_2.png) [@simonw\_2](https://discuss.elastic.co/u/simonw_2)\
**Post date:** [August 3, 2013, 7:05am UTC](https://discuss.elastic.co/t/elasticsearch-0-90-how-to-make-big-segment-at-first-place/13050/2 "2013-08-03T07:05:55Z")

</div>

raising your refresh interval should help here. We flush every 3 sec by  
default which creates lots of segments. if you set it to -1 you can control  
it yourself by calling flush or refresh via the API. You should also look  
at indices.memory.index\_buffer\_size ([Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/modules/indices/))  
to control how much ram is used for doc buffering. Yet, Lucene 4 works  
differently and doesn't merge everything in memory. you can use less  
threads and it will create less segments. Note, for throughput it might be  
better to write more but smaller segments though.

simon

On Saturday, August 3, 2013 3:59:30 AM UTC+2, Prakash Patidar wrote:

> Hi,  
> We are using Elasticsearch(ES) to index large number of documents every  
> day.  
> By default , Elasticsearch(Lucene) is creating smaller segments and it's  
> background threads makes them bigger based on merging policy.  
> To reduce merge cycles and have efficient segment at first place , i would  
> like ES to create bigger segment in memory and writes to disk(no probs if  
> it uses more memory and searches are available only after it flushes  
> segments to disk).  
> I knew Older version of Lucene 3.0 had setting \*setMaxBufferedDocs[http://lucene.apache.org/core/2\_9\_4/api/all/org/apache/lucene/index/IndexWriter.html#setMaxBufferedDocs(int)](http://lucene.apache.org/core/2_9_4/api/all/org/apache/lucene/index/IndexWriter.html#setMaxBufferedDocs(int))  
> (\*Determines the minimal number of documents required before the  
> buffered in-memory documents are flushed as a new Segment).
> 
> Can I do the same in ES where creating bigger segments(may be 100 MB or  
> bigger ) and reduce merge cycles(max 1 merge or will avoid merge and run  
> force merge at the end of day , as i am creating new index every day) to  
> reduce IO substantially.
> 
> Regards,  
> Prakash

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:23am UTC](https://discuss.elastic.co/t/elasticsearch-0-90-how-to-make-big-segment-at-first-place/13050/3 "2017-07-06T02:23:10Z")

</div>


