ML: Fix build after HLRC change
I recently merged a HLRC change that passed the PR builds but didn't compile after merging. Sad time. This fixes the compilation.
This commit is contained in:
parent
dbc7102c86
commit
ebd5eb6dc2
|
@ -196,15 +196,12 @@ public class TransportDeleteForecastAction extends HandledTransportAction<Delete
|
||||||
}
|
}
|
||||||
|
|
||||||
private DeleteByQueryRequest buildDeleteByQuery(String jobId, List<String> forecastsToDelete) {
|
private DeleteByQueryRequest buildDeleteByQuery(String jobId, List<String> forecastsToDelete) {
|
||||||
SearchRequest searchRequest = new SearchRequest();
|
DeleteByQueryRequest request = new DeleteByQueryRequest()
|
||||||
// We need to create the DeleteByQueryRequest before we modify the SearchRequest
|
|
||||||
// because the constructor of the former wipes the latter
|
|
||||||
DeleteByQueryRequest request = new DeleteByQueryRequest(searchRequest)
|
|
||||||
.setAbortOnVersionConflict(false) //since these documents are not updated, a conflict just means it was deleted previously
|
.setAbortOnVersionConflict(false) //since these documents are not updated, a conflict just means it was deleted previously
|
||||||
.setSize(MAX_FORECAST_TO_SEARCH)
|
.setSize(MAX_FORECAST_TO_SEARCH)
|
||||||
.setSlices(5);
|
.setSlices(5);
|
||||||
|
|
||||||
searchRequest.indices(AnomalyDetectorsIndex.jobResultsAliasedName(jobId));
|
request.indices(AnomalyDetectorsIndex.jobResultsAliasedName(jobId));
|
||||||
BoolQueryBuilder innerBoolQuery = QueryBuilders.boolQuery();
|
BoolQueryBuilder innerBoolQuery = QueryBuilders.boolQuery();
|
||||||
innerBoolQuery
|
innerBoolQuery
|
||||||
.must(QueryBuilders.termsQuery(Result.RESULT_TYPE.getPreferredName(),
|
.must(QueryBuilders.termsQuery(Result.RESULT_TYPE.getPreferredName(),
|
||||||
|
@ -213,7 +210,7 @@ public class TransportDeleteForecastAction extends HandledTransportAction<Delete
|
||||||
forecastsToDelete));
|
forecastsToDelete));
|
||||||
|
|
||||||
QueryBuilder query = QueryBuilders.boolQuery().filter(innerBoolQuery);
|
QueryBuilder query = QueryBuilders.boolQuery().filter(innerBoolQuery);
|
||||||
searchRequest.source(new SearchSourceBuilder().query(query));
|
request.setQuery(query);
|
||||||
return request;
|
return request;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue