# Percolator sometimes doesn't refresh queries

**URL:** <https://discuss.elastic.co/t/percolator-sometimes-doesnt-refresh-queries/16496>\
**Category:** Elasticsearch\
**Created:** [March 20, 2014, 11:58am UTC](https://discuss.elastic.co/t/percolator-sometimes-doesnt-refresh-queries/16496 "2014-03-20T11:58:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tomasz\_Romanczuk](https://avatars.discourse-cdn.com/v4/letter/t/5e9695/32.png) [@Tomasz\_Romanczuk](https://discuss.elastic.co/u/Tomasz_Romanczuk)\
**Post date:** [March 20, 2014, 11:58am UTC](https://discuss.elastic.co/t/percolator-sometimes-doesnt-refresh-queries/16496/1 "2014-03-20T11:58:08Z")

</div>

I indexed 100000 queries in percolator index. Next 90000 was deleted.  
Sometimes it looks like index didn't refresh (I repeated step many times),  
deleted queries are still matched and returned in resposne. I tried to  
clear cache and refresh index, but sometimes it doesn't work, my code:

BulkRequestBuilder bulkRequest = client.prepareBulk();  
while (some condition) {  
bulkRequest.add(client.prepareIndex("\_percolator", INDEX\_NAME,  
id).setSource(...));  
}  
while (some condition) {  
bulkRequest.add(client.prepareDelete("\_percolator", INDEX\_NAME, id));  
}  
BulkResponse response = bulkRequest.setRefresh(true).execute().actionGet();  
client.admin().indices().prepareClearCache(INDEX\_NAME).execute().actionGet();  
client.admin().indices().prepareClearCache(PERCOLATOR).execute().actionGet();  
client.admin().indices().prepareRefresh(INDEX\_NAME).execute().actionGet();  
client.admin().indices().prepareRefresh(PERCOLATOR).execute().actionGet();

How to make sure that after bulk request (response.hasFailures() always  
returns false) percolator index will be refreshed?

--  
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/4315acb8-8e7e-40bf-a89c-18d8fa476408%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/4315acb8-8e7e-40bf-a89c-18d8fa476408%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:41am UTC](https://discuss.elastic.co/t/percolator-sometimes-doesnt-refresh-queries/16496/2 "2017-07-06T01:41:54Z")

</div>


