# Newbie ES Questions regarding batch commits, performance, etc

**URL:** https://discuss.elastic.co/t/newbie-es-questions-regarding-batch-commits-performance-etc/72546
**Category:** Elasticsearch
**Created:** [January 23, 2017, 10:50pm UTC](https://discuss.elastic.co/t/newbie-es-questions-regarding-batch-commits-performance-etc/72546 "2017-01-23T22:50:34Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![lukes](https://avatars.discourse-cdn.com/v4/letter/l/4da419/32.png) [@lukes](https://discuss.elastic.co/u/lukes)
#### Post date: [January 23, 2017, 10:50pm UTC](https://discuss.elastic.co/t/newbie-es-questions-regarding-batch-commits-performance-etc/72546/1 "2017-01-23T22:50:34Z")

</div>

Hi all,

I am planning to ES for indexing(Coming from Lucene) and querying good volume of data. Use case is, 10-20 documents / second(roughly around 40-50 fields) and in parallel doing query.

-- In Lucene i can directly add the document to indexWriter and do the commit in background(Custom thread after n number of minutes). I was using ControlledRealTimeReopenThread and TrackingIndexWriter for query, so that documents are immediately available for search(Even though they are not committed yet). How is it possible to achieve this functionality in ES ? I'll be using REST client for indexing and query.

-- Also do i need to keep track of documents got committed for book-keeping ? What if document was added, but before the commit happened node went down(Assume single node deployment). Now when node comes back, would document be re-indexed automatically(Does ES uses JMS or embedded queues) ? If not, how can i get list of documents got committed ?

Can someone point me to the resource/wiki/example to cover above ?

Regards.

Regards.

---

<div class="post-metadata">

### Author: ![lukes](https://avatars.discourse-cdn.com/v4/letter/l/4da419/32.png) [@lukes](https://discuss.elastic.co/u/lukes)
#### Post date: [January 24, 2017, 8:11pm UTC](https://discuss.elastic.co/t/newbie-es-questions-regarding-batch-commits-performance-etc/72546/2 "2017-01-24T20:11:38Z")

</div>

Hi experts, can anyone help answering above questions ?

Regards.

---

<div class="post-metadata">

### Author: ![dakrone](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dakrone/32/23351_2.png) [@dakrone](https://discuss.elastic.co/u/dakrone)
#### Post date: [January 24, 2017, 11:35pm UTC](https://discuss.elastic.co/t/newbie-es-questions-regarding-batch-commits-performance-etc/72546/3 "2017-01-24T23:35:26Z")

</div>

[quote="lukes, post:1, topic:72546"]  
-- In Lucene i can directly add the document to indexWriter and do the commit in  
background(Custom thread after n number of minutes). I was using  
ControlledRealTimeReopenThread and TrackingIndexWriter for query, so that  
documents are immediately available for search(Even though they are not  
committed yet). How is it possible to achieve this functionality in ES ? I'll  
be using REST client for indexing and query. [/quote]

Elasticsearch will automatically refresh (Lucene flush) and re-open the searcher  
to make documents visible by default every second. You can change this interval  
dynamically to be higher, or disable automatic refresh entirely (you can  
explicitly refresh also).

[quote="lukes, post:1, topic:72546"]  
-- Also do i need to keep track of documents got committed for book-keeping ?  
What if document was added, but before the commit happened node went down(Assume  
single node deployment). Now when node comes back, would document be re-indexed  
automatically(Does ES uses JMS or embedded queues) ? If not, how can i get list  
of documents got committed ? [/quote]

No, Elasticsearch puts documents that are acknowledged but not yet committed  
into its Translog, which is fsynced to disk after each request. If ES were to  
die during this period, the translog is replayed when Elasticsearch is started  
back up so that documents that were not yet committed are not lost.

---

<div class="post-metadata">

### Author: ![lukes](https://avatars.discourse-cdn.com/v4/letter/l/4da419/32.png) [@lukes](https://discuss.elastic.co/u/lukes)
#### Post date: [January 24, 2017, 11:52pm UTC](https://discuss.elastic.co/t/newbie-es-questions-regarding-batch-commits-performance-etc/72546/4 "2017-01-24T23:52:14Z")

</div>

Thanks a lot @dakrone ...

Regards.

---

<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: [February 21, 2017, 11:52pm UTC](https://discuss.elastic.co/t/newbie-es-questions-regarding-batch-commits-performance-etc/72546/5 "2017-02-21T23:52:46Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
