SearchContext context = SearchContext.current();
if (context == null) {
throw new QueryParsingException(parseContext.index(), "[" + name + "] query and filter requires a search context");
}
if (TransportShardDeleteByQueryAction.DELETE_BY_QUERY_API.equals(context.source())) {
throw new QueryParsingException(parseContext.index(), "[" + name + "] query and filter unsupported in delete_by_query api");
}
}
}