private SearchResponse doSearchTemplateRequest(String query, Map<String, Object> params) throws IOException {
        SearchTemplateRequest searchTemplateRequest = new SearchTemplateRequest();
        searchTemplateRequest.setRequest(new SearchRequest(INDEX_NAME));
        searchTemplateRequest.setScriptType(ScriptType.INLINE);
        searchTemplateRequest.setScript(query);
        searchTemplateRequest.setScriptParams(params);
        return getClient().searchTemplate(searchTemplateRequest, RequestOptions.DEFAULT).getResponse();
    }
Does a request against elasticsearch
@param query the query template to execute
@param params the params for the query template
@return SearchResponse of elasticsearch
@throws IOException
manager/api/es/src/main/java/io/apiman/manager/api/es/EsMetricsAccessor.java