# Force refresh after each operation, for unit tests

**URL:** <https://discuss.elastic.co/t/force-refresh-after-each-operation-for-unit-tests/9438>\
**Category:** Elasticsearch\
**Created:** [October 22, 2012, 4:23pm UTC](https://discuss.elastic.co/t/force-refresh-after-each-operation-for-unit-tests/9438 "2012-10-22T16:23:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Filirom1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/filirom1/32/2234_2.png) [@Filirom1](https://discuss.elastic.co/u/Filirom1)\
**Post date:** [October 22, 2012, 4:23pm UTC](https://discuss.elastic.co/t/force-refresh-after-each-operation-for-unit-tests/9438/1 "2012-10-22T16:23:50Z")

</div>

Hi everybody !

In my unit tests I have a lot of sleep that waits for the refresh interval  
(1s);  
I would like to speed up my tests. Executing them in parrallel is not an  
option.

Is there a way to force ElasticSearch to refresh after each operation, in  
the elasticsearch.yml configuration file ?

Thanks

Romain

--

---

<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:** [October 22, 2012, 4:37pm UTC](https://discuss.elastic.co/t/force-refresh-after-each-operation-for-unit-tests/9438/2 "2012-10-22T16:37:20Z")

</div>

hey,

can't you forcefully refresh manually via the refresh  
API? [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-refresh.html)

simon

On Monday, October 22, 2012 6:24:15 PM UTC+2, Filirom1 wrote:

> Hi everybody !
> 
> In my unit tests I have a lot of sleep that waits for the refresh interval  
> (1s);  
> I would like to speed up my tests. Executing them in parrallel is not an  
> option.
> 
> Is there a way to force Elasticsearch to refresh after each operation, in  
> the elasticsearch.yml configuration file ?
> 
> Thanks
> 
> Romain

--

---

<div class="post-metadata">

**Author:** ![Filirom1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/filirom1/32/2234_2.png) [@Filirom1](https://discuss.elastic.co/u/Filirom1)\
**Post date:** [October 22, 2012, 5:01pm UTC](https://discuss.elastic.co/t/force-refresh-after-each-operation-for-unit-tests/9438/3 "2012-10-22T17:01:21Z")

</div>

Indeed.

I replace every sleep by a call to the refresh API.

Thanks  
Romain

2012/10/22 simonw [simon.willnauer@elasticsearch.com](mailto:simon.willnauer@elasticsearch.com)

> hey,
> 
> can't you forcefully refresh manually via the refresh API?  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-refresh.html)
> 
> simon
> 
> On Monday, October 22, 2012 6:24:15 PM UTC+2, Filirom1 wrote:
> 
> > Hi everybody !
> > 
> > In my unit tests I have a lot of sleep that waits for the refresh  
> > interval (1s);  
> > I would like to speed up my tests. Executing them in parrallel is not an  
> > option.
> > 
> > Is there a way to force Elasticsearch to refresh after each operation,  
> > in the elasticsearch.yml configuration file ?
> > 
> > Thanks
> > 
> > Romain
> 
> --

--

---

<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/force-refresh-after-each-operation-for-unit-tests/9438/4 "2017-07-06T03:07:34Z")

</div>


