# How to delete queries from percolator?

**URL:** <https://discuss.elastic.co/t/how-to-delete-queries-from-percolator/16493>\
**Category:** Elasticsearch\
**Created:** [March 20, 2014, 10:17am UTC](https://discuss.elastic.co/t/how-to-delete-queries-from-percolator/16493 "2014-03-20T10:17:02Z")\
**Posts on this page:** 3\
**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, 10:17am UTC](https://discuss.elastic.co/t/how-to-delete-queries-from-percolator/16493/1 "2014-03-20T10:17:02Z")

</div>

I have indexed 10000 queries in percolator. Next I want to update some of  
them and delete 9000 queries. I use bulk request, operation seems to finish  
with success (without fails). But after all deleted queries still are  
returned. Below code refreshing index:

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();

response.hasFailures() returns _false_. Is there any bug in elasticsearch  
or am I doing something wrong? Application restart helps, index is  
refreshed but I want do it online without restarts.

--  
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/b7930318-82ff-46ec-a838-2cecad943fff%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b7930318-82ff-46ec-a838-2cecad943fff%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 10:30am UTC](https://discuss.elastic.co/t/how-to-delete-queries-from-percolator/16493/2 "2014-03-20T10:30:34Z")

</div>

Got it! Seems that clear cache is workaround 🙂  
client.admin().indices().prepareClearCache(INDEX\_NAME).execute().actionGet();

W dniu czwartek, 20 marca 2014 11:17:02 UTC+1 użytkownik Tomasz Romanczuk  
napisał:

> I have indexed 10000 queries in percolator. Next I want to update some of  
> them and delete 9000 queries. I use bulk request, operation seems to finish  
> with success (without fails). But after all deleted queries still are  
> returned. Below code refreshing index:
> 
> 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();
> 
> response.hasFailures() returns _false_. Is there any bug in elasticsearch  
> or am I doing something wrong? Application restart helps, index is  
> refreshed but I want do it online without restarts.

--  
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/57b3c75b-e90b-4ef4-9a91-ceb09375c3bd%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/57b3c75b-e90b-4ef4-9a91-ceb09375c3bd%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/how-to-delete-queries-from-percolator/16493/3 "2017-07-06T01:41:55Z")

</div>


