I wish to delete all the percolator queries on an index, but leave the documents intact.
Is there an easy way to perform this?
I wish to delete all the percolator queries on an index, but leave the documents intact.
Is there an easy way to perform this?
Meanwhile this is fixed. The following command will delete all the percoaltor queries:
curl -XDELETE 'localhost:9200/my-index/.percolator/_query' -d '{
"query" : {
"match_all" : {}
}
}'
Percolator is special type with name .percolator
in your index.
Every query registered in percolator is just a document in this type.
Knowing this fact, you can delete all queries from percolator like this:
$client = new Elastica\Client();
$index = $client->getIndex('myindex');
$percolator = $index->getType('.percolator');
$percolator->delete();
It seems like you should be able to use delete-by-query and the match-all query on the .percolator
type of the index. This does not work and is a long-reported ES bug (see here and then here).
The next best solution is to run a query against the .percolator
type and then loop over the results, deleting each percolator document individually.
(Edited because initial answer was wrong.)