How to delete queries from percolator?


(Tomasz Romanczuk) #1

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/b7930318-82ff-46ec-a838-2cecad943fff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(Tomasz Romanczuk) #2

Got it! Seems that clear cache is workaround :slight_smile:
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/57b3c75b-e90b-4ef4-9a91-ceb09375c3bd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(system) #3