ElasticsearchQueryRequest implements ElasticsearchRequest { @VisibleForTesting protected SearchRequest searchRequest() { return new SearchRequest() .indices(indexName) .source(sourceBuilder); } ElasticsearchQueryRequest(String indexName, int size,
                                   ElasticsearchExprValueFactory factory); @Override ElasticsearchResponse search(Function<SearchRequest, SearchResponse> searchAction,
                                      Function<SearchScrollRequest, SearchResponse> scrollAction); @Override void clean(Consumer<String> cleanAction); static final TimeValue DEFAULT_QUERY_TIMEOUT; }
@Test void searchRequest() { request.getSourceBuilder().query(QueryBuilders.termQuery("name", "John")); assertEquals( new SearchRequest() .indices("test") .source(new SearchSourceBuilder() .timeout(ElasticsearchQueryRequest.DEFAULT_QUERY_TIMEOUT) .from(0) .size(200) .query(QueryBuilders.termQuery("name", "John"))), request.searchRequest()); }