Core: Pass down the types from the delete mapping request to the delete by query request.

The `.percolator` type is a hidden type and therefor the types from the delete mapping request should passed down to the delete by query request, otherwise the percolator type gets ignored and the percolator queries don't get deleted from disk (only unregistered).

Closes #7087
This commit is contained in:
Martijn van Groningen 2014-07-30 14:35:05 +02:00
parent c1b6e53cbb
commit 2801d06aee
2 changed files with 4 additions and 1 deletions

View File

@ -138,7 +138,7 @@ public class TransportDeleteMappingAction extends TransportMasterNodeOperationAc
request.types(types.toArray(new String[types.size()]));
QuerySourceBuilder querySourceBuilder = new QuerySourceBuilder()
.setQuery(QueryBuilders.filteredQuery(QueryBuilders.matchAllQuery(), filterBuilder));
deleteByQueryAction.execute(Requests.deleteByQueryRequest(concreteIndices).source(querySourceBuilder), new ActionListener<DeleteByQueryResponse>() {
deleteByQueryAction.execute(Requests.deleteByQueryRequest(concreteIndices).types(request.types()).source(querySourceBuilder), new ActionListener<DeleteByQueryResponse>() {
@Override
public void onResponse(DeleteByQueryResponse deleteByQueryResponse) {
if (logger.isTraceEnabled()) {

View File

@ -1611,6 +1611,9 @@ public class PercolatorTests extends ElasticsearchIntegrationTest {
.setPercolateDoc(docBuilder().setDoc(jsonBuilder().startObject().field("field1", "b").endObject()))
.execute().actionGet();
assertMatchCount(response, 0l);
SearchResponse searchResponse = client().prepareSearch("test1", "test2").get();
assertHitCount(searchResponse, 0);
}
public static String[] convertFromTextArray(PercolateResponse.Match[] matches, String index) {