Skip to content

Commit

Permalink
Core: Pass down the types from the delete mapping request to the dele…
Browse files Browse the repository at this point in the history
…te 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
  • Loading branch information
martijnvg committed Aug 11, 2014
1 parent eb2ddea commit 2bf63ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Expand Up @@ -138,7 +138,7 @@ public void onResponse(FlushResponse flushResponse) {
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()) {
Expand Down
Expand Up @@ -1611,6 +1611,9 @@ public boolean apply(Object o) {
.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) {
Expand Down

0 comments on commit 2bf63ae

Please sign in to comment.