@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()); }
@VisibleForTesting protected SearchRequest searchRequest() { return new SearchRequest() .indices(indexName) .source(sourceBuilder); }
ElasticsearchQueryRequest implements ElasticsearchRequest { @VisibleForTesting protected SearchRequest searchRequest() { return new SearchRequest() .indices(indexName) .source(sourceBuilder); } }
ElasticsearchQueryRequest implements ElasticsearchRequest { @VisibleForTesting protected SearchRequest searchRequest() { return new SearchRequest() .indices(indexName) .source(sourceBuilder); } ElasticsearchQueryRequest(String indexName, int size,
                                   ElasticsearchExprValueFactory factory); }
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); }
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; }