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:
parent
c1b6e53cbb
commit
2801d06aee
|
@ -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()) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue