@Test public void testQueryEmptyResult() throws FoxtrotException, JsonProcessingException { Query query = new Query(); query.setTable(TestUtils.TEST_TABLE_NAME); EqualsFilter equalsFilter = new EqualsFilter(); equalsFilter.setField("os"); equalsFilter.setValue("wp8"); query.setFilters(Lists.<Filter>newArrayList(equalsFilter)); List<Document> documents = new ArrayList<Document>(); QueryResponse actualResponse = QueryResponse.class.cast(getQueryExecutor().execute(query)); compare(documents, actualResponse.getDocuments()); }
@Override public ActionResponse execute(Query parameter) { SearchRequestBuilder search = getRequestBuilder(parameter); try { logger.info("Search: {}", search); SearchResponse response = search.execute() .actionGet(getGetQueryTimeout()); return getResponse(response, parameter); } catch (ElasticsearchException e) { throw FoxtrotExceptions.createQueryExecutionException(parameter, e); } }
FilterAction extends Action<Query> { @Override public ActionResponse execute(Query parameter) { SearchRequestBuilder search = getRequestBuilder(parameter); try { logger.info("Search: {}", search); SearchResponse response = search.execute() .actionGet(getGetQueryTimeout()); return getResponse(response, parameter); } catch (ElasticsearchException e) { throw FoxtrotExceptions.createQueryExecutionException(parameter, e); } } }
FilterAction extends Action<Query> { @Override public ActionResponse execute(Query parameter) { SearchRequestBuilder search = getRequestBuilder(parameter); try { logger.info("Search: {}", search); SearchResponse response = search.execute() .actionGet(getGetQueryTimeout()); return getResponse(response, parameter); } catch (ElasticsearchException e) { throw FoxtrotExceptions.createQueryExecutionException(parameter, e); } } FilterAction(Query parameter, AnalyticsLoader analyticsLoader); }
FilterAction extends Action<Query> { @Override public ActionResponse execute(Query parameter) { SearchRequestBuilder search = getRequestBuilder(parameter); try { logger.info("Search: {}", search); SearchResponse response = search.execute() .actionGet(getGetQueryTimeout()); return getResponse(response, parameter); } catch (ElasticsearchException e) { throw FoxtrotExceptions.createQueryExecutionException(parameter, e); } } FilterAction(Query parameter, AnalyticsLoader analyticsLoader); @Override void preprocess(); @Override String getMetricKey(); @Override String getRequestCacheKey(); @Override void validateImpl(Query parameter); @Override ActionResponse execute(Query parameter); @Override SearchRequestBuilder getRequestBuilder(Query parameter); @Override ActionResponse getResponse(org.elasticsearch.action.ActionResponse response, Query parameter); }
FilterAction extends Action<Query> { @Override public ActionResponse execute(Query parameter) { SearchRequestBuilder search = getRequestBuilder(parameter); try { logger.info("Search: {}", search); SearchResponse response = search.execute() .actionGet(getGetQueryTimeout()); return getResponse(response, parameter); } catch (ElasticsearchException e) { throw FoxtrotExceptions.createQueryExecutionException(parameter, e); } } FilterAction(Query parameter, AnalyticsLoader analyticsLoader); @Override void preprocess(); @Override String getMetricKey(); @Override String getRequestCacheKey(); @Override void validateImpl(Query parameter); @Override ActionResponse execute(Query parameter); @Override SearchRequestBuilder getRequestBuilder(Query parameter); @Override ActionResponse getResponse(org.elasticsearch.action.ActionResponse response, Query parameter);  }