Search in sources :

Example 96 with SearchRequest

use of org.opensearch.action.search.SearchRequest in project OpenSearch by opensearch-project.

the class SearchIT method testSearchWithTermsAndWeightedAvg.

public void testSearchWithTermsAndWeightedAvg() throws IOException {
    SearchRequest searchRequest = new SearchRequest("index");
    SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
    TermsAggregationBuilder agg = new TermsAggregationBuilder("agg1").userValueTypeHint(ValueType.STRING).field("type.keyword");
    agg.subAggregation(new WeightedAvgAggregationBuilder("subagg").value(new MultiValuesSourceFieldConfig.Builder().setFieldName("num").build()).weight(new MultiValuesSourceFieldConfig.Builder().setFieldName("num2").build()));
    searchSourceBuilder.aggregation(agg);
    searchSourceBuilder.size(0);
    searchRequest.source(searchSourceBuilder);
    SearchResponse searchResponse = execute(searchRequest, highLevelClient()::search, highLevelClient()::searchAsync);
    assertSearchHeader(searchResponse);
    assertNull(searchResponse.getSuggest());
    assertEquals(Collections.emptyMap(), searchResponse.getProfileResults());
    assertEquals(0, searchResponse.getHits().getHits().length);
    assertEquals(Float.NaN, searchResponse.getHits().getMaxScore(), 0f);
    Terms termsAgg = searchResponse.getAggregations().get("agg1");
    assertEquals("agg1", termsAgg.getName());
    assertEquals(2, termsAgg.getBuckets().size());
    Terms.Bucket type1 = termsAgg.getBucketByKey("type1");
    assertEquals(3, type1.getDocCount());
    assertEquals(1, type1.getAggregations().asList().size());
    {
        WeightedAvg weightedAvg = type1.getAggregations().get("subagg");
        assertEquals(24.4, weightedAvg.getValue(), 0f);
    }
    Terms.Bucket type2 = termsAgg.getBucketByKey("type2");
    assertEquals(2, type2.getDocCount());
    assertEquals(1, type2.getAggregations().asList().size());
    {
        WeightedAvg weightedAvg = type2.getAggregations().get("subagg");
        assertEquals(100, weightedAvg.getValue(), 0f);
    }
}
Also used : MultiSearchRequest(org.opensearch.action.search.MultiSearchRequest) SearchRequest(org.opensearch.action.search.SearchRequest) RareTermsAggregationBuilder(org.opensearch.search.aggregations.bucket.terms.RareTermsAggregationBuilder) TermsAggregationBuilder(org.opensearch.search.aggregations.bucket.terms.TermsAggregationBuilder) MultiValuesSourceFieldConfig(org.opensearch.search.aggregations.support.MultiValuesSourceFieldConfig) RangeAggregationBuilder(org.opensearch.search.aggregations.bucket.range.RangeAggregationBuilder) ChildrenAggregationBuilder(org.opensearch.join.aggregations.ChildrenAggregationBuilder) WeightedAvgAggregationBuilder(org.opensearch.search.aggregations.metrics.WeightedAvgAggregationBuilder) SuggestBuilder(org.opensearch.search.suggest.SuggestBuilder) QueryBuilder(org.opensearch.index.query.QueryBuilder) SearchSourceBuilder(org.opensearch.search.builder.SearchSourceBuilder) TermsQueryBuilder(org.opensearch.index.query.TermsQueryBuilder) TermsValuesSourceBuilder(org.opensearch.search.aggregations.bucket.composite.TermsValuesSourceBuilder) XContentFactory.jsonBuilder(org.opensearch.common.xcontent.XContentFactory.jsonBuilder) HighlightBuilder(org.opensearch.search.fetch.subphase.highlight.HighlightBuilder) ScriptQueryBuilder(org.opensearch.index.query.ScriptQueryBuilder) MatrixStatsAggregationBuilder(org.opensearch.search.aggregations.matrix.stats.MatrixStatsAggregationBuilder) XContentBuilder(org.opensearch.common.xcontent.XContentBuilder) CompositeValuesSourceBuilder(org.opensearch.search.aggregations.bucket.composite.CompositeValuesSourceBuilder) RareTermsAggregationBuilder(org.opensearch.search.aggregations.bucket.terms.RareTermsAggregationBuilder) PhraseSuggestionBuilder(org.opensearch.search.suggest.phrase.PhraseSuggestionBuilder) TermsAggregationBuilder(org.opensearch.search.aggregations.bucket.terms.TermsAggregationBuilder) MatchQueryBuilder(org.opensearch.index.query.MatchQueryBuilder) RareTerms(org.opensearch.search.aggregations.bucket.terms.RareTerms) Terms(org.opensearch.search.aggregations.bucket.terms.Terms) WeightedAvgAggregationBuilder(org.opensearch.search.aggregations.metrics.WeightedAvgAggregationBuilder) SearchSourceBuilder(org.opensearch.search.builder.SearchSourceBuilder) MultiSearchResponse(org.opensearch.action.search.MultiSearchResponse) SearchResponse(org.opensearch.action.search.SearchResponse) WeightedAvg(org.opensearch.search.aggregations.metrics.WeightedAvg)

Example 97 with SearchRequest

use of org.opensearch.action.search.SearchRequest in project OpenSearch by opensearch-project.

the class SearchIT method testMultiSearch_withAgg.

public void testMultiSearch_withAgg() throws Exception {
    MultiSearchRequest multiSearchRequest = new MultiSearchRequest();
    SearchRequest searchRequest1 = new SearchRequest("index1");
    searchRequest1.source().size(0).aggregation(new TermsAggregationBuilder("name").userValueTypeHint(ValueType.STRING).field("field.keyword").order(BucketOrder.key(true)));
    multiSearchRequest.add(searchRequest1);
    SearchRequest searchRequest2 = new SearchRequest("index2");
    searchRequest2.source().size(0).aggregation(new TermsAggregationBuilder("name").userValueTypeHint(ValueType.STRING).field("field.keyword").order(BucketOrder.key(true)));
    multiSearchRequest.add(searchRequest2);
    SearchRequest searchRequest3 = new SearchRequest("index3");
    searchRequest3.source().size(0).aggregation(new TermsAggregationBuilder("name").userValueTypeHint(ValueType.STRING).field("field.keyword").order(BucketOrder.key(true)));
    multiSearchRequest.add(searchRequest3);
    MultiSearchResponse multiSearchResponse = execute(multiSearchRequest, highLevelClient()::msearch, highLevelClient()::msearchAsync);
    assertThat(multiSearchResponse.getTook().millis(), Matchers.greaterThanOrEqualTo(0L));
    assertThat(multiSearchResponse.getResponses().length, Matchers.equalTo(3));
    assertThat(multiSearchResponse.getResponses()[0].getFailure(), Matchers.nullValue());
    assertThat(multiSearchResponse.getResponses()[0].isFailure(), Matchers.is(false));
    SearchIT.assertSearchHeader(multiSearchResponse.getResponses()[0].getResponse());
    assertThat(multiSearchResponse.getResponses()[0].getResponse().getHits().getTotalHits().value, Matchers.equalTo(2L));
    assertThat(multiSearchResponse.getResponses()[0].getResponse().getHits().getHits().length, Matchers.equalTo(0));
    Terms terms = multiSearchResponse.getResponses()[0].getResponse().getAggregations().get("name");
    assertThat(terms.getBuckets().size(), Matchers.equalTo(2));
    assertThat(terms.getBuckets().get(0).getKeyAsString(), Matchers.equalTo("value1"));
    assertThat(terms.getBuckets().get(1).getKeyAsString(), Matchers.equalTo("value2"));
    assertThat(multiSearchResponse.getResponses()[1].getFailure(), Matchers.nullValue());
    assertThat(multiSearchResponse.getResponses()[1].isFailure(), Matchers.is(false));
    SearchIT.assertSearchHeader(multiSearchResponse.getResponses()[0].getResponse());
    assertThat(multiSearchResponse.getResponses()[1].getResponse().getHits().getTotalHits().value, Matchers.equalTo(2L));
    assertThat(multiSearchResponse.getResponses()[1].getResponse().getHits().getHits().length, Matchers.equalTo(0));
    terms = multiSearchResponse.getResponses()[1].getResponse().getAggregations().get("name");
    assertThat(terms.getBuckets().size(), Matchers.equalTo(2));
    assertThat(terms.getBuckets().get(0).getKeyAsString(), Matchers.equalTo("value1"));
    assertThat(terms.getBuckets().get(1).getKeyAsString(), Matchers.equalTo("value2"));
    assertThat(multiSearchResponse.getResponses()[2].getFailure(), Matchers.nullValue());
    assertThat(multiSearchResponse.getResponses()[2].isFailure(), Matchers.is(false));
    SearchIT.assertSearchHeader(multiSearchResponse.getResponses()[0].getResponse());
    assertThat(multiSearchResponse.getResponses()[2].getResponse().getHits().getTotalHits().value, Matchers.equalTo(2L));
    assertThat(multiSearchResponse.getResponses()[2].getResponse().getHits().getHits().length, Matchers.equalTo(0));
    terms = multiSearchResponse.getResponses()[2].getResponse().getAggregations().get("name");
    assertThat(terms.getBuckets().size(), Matchers.equalTo(2));
    assertThat(terms.getBuckets().get(0).getKeyAsString(), Matchers.equalTo("value1"));
    assertThat(terms.getBuckets().get(1).getKeyAsString(), Matchers.equalTo("value2"));
}
Also used : MultiSearchRequest(org.opensearch.action.search.MultiSearchRequest) SearchRequest(org.opensearch.action.search.SearchRequest) MultiSearchResponse(org.opensearch.action.search.MultiSearchResponse) RareTermsAggregationBuilder(org.opensearch.search.aggregations.bucket.terms.RareTermsAggregationBuilder) TermsAggregationBuilder(org.opensearch.search.aggregations.bucket.terms.TermsAggregationBuilder) RareTerms(org.opensearch.search.aggregations.bucket.terms.RareTerms) Terms(org.opensearch.search.aggregations.bucket.terms.Terms) MultiSearchRequest(org.opensearch.action.search.MultiSearchRequest)

Example 98 with SearchRequest

use of org.opensearch.action.search.SearchRequest in project OpenSearch by opensearch-project.

the class SearchIT method testSearchWithParentJoin.

public void testSearchWithParentJoin() throws IOException {
    final String indexName = "child_example";
    Request createIndex = new Request(HttpPut.METHOD_NAME, "/" + indexName);
    createIndex.setJsonEntity("{\n" + "    \"mappings\": {\n" + "        \"properties\" : {\n" + "            \"qa_join_field\" : {\n" + "                \"type\" : \"join\",\n" + "                \"relations\" : { \"question\" : \"answer\" }\n" + "            }\n" + "        }\n" + "    }" + "}");
    client().performRequest(createIndex);
    Request questionDoc = new Request(HttpPut.METHOD_NAME, "/" + indexName + "/_doc/1");
    questionDoc.setJsonEntity("{\n" + "    \"body\": \"<p>I have Windows 2003 server and i bought a new Windows 2008 server...\",\n" + "    \"title\": \"Whats the best way to file transfer my site from server to a newer one?\",\n" + "    \"tags\": [\n" + "        \"windows-server-2003\",\n" + "        \"windows-server-2008\",\n" + "        \"file-transfer\"\n" + "    ],\n" + "    \"qa_join_field\" : \"question\"\n" + "}");
    client().performRequest(questionDoc);
    Request answerDoc1 = new Request(HttpPut.METHOD_NAME, "/" + indexName + "/_doc/2");
    answerDoc1.addParameter("routing", "1");
    answerDoc1.setJsonEntity("{\n" + "    \"owner\": {\n" + "        \"location\": \"Norfolk, United Kingdom\",\n" + "        \"display_name\": \"Sam\",\n" + "        \"id\": 48\n" + "    },\n" + "    \"body\": \"<p>Unfortunately you're pretty much limited to FTP...\",\n" + "    \"qa_join_field\" : {\n" + "        \"name\" : \"answer\",\n" + "        \"parent\" : \"1\"\n" + "    },\n" + "    \"creation_date\": \"2009-05-04T13:45:37.030\"\n" + "}");
    client().performRequest(answerDoc1);
    Request answerDoc2 = new Request(HttpPut.METHOD_NAME, "/" + indexName + "/_doc/3");
    answerDoc2.addParameter("routing", "1");
    answerDoc2.setJsonEntity("{\n" + "    \"owner\": {\n" + "        \"location\": \"Norfolk, United Kingdom\",\n" + "        \"display_name\": \"Troll\",\n" + "        \"id\": 49\n" + "    },\n" + "    \"body\": \"<p>Use Linux...\",\n" + "    \"qa_join_field\" : {\n" + "        \"name\" : \"answer\",\n" + "        \"parent\" : \"1\"\n" + "    },\n" + "    \"creation_date\": \"2009-05-05T13:45:37.030\"\n" + "}");
    client().performRequest(answerDoc2);
    client().performRequest(new Request(HttpPost.METHOD_NAME, "/_refresh"));
    TermsAggregationBuilder leafTermAgg = new TermsAggregationBuilder("top-names").userValueTypeHint(ValueType.STRING).field("owner.display_name.keyword").size(10);
    ChildrenAggregationBuilder childrenAgg = new ChildrenAggregationBuilder("to-answers", "answer").subAggregation(leafTermAgg);
    TermsAggregationBuilder termsAgg = new TermsAggregationBuilder("top-tags").userValueTypeHint(ValueType.STRING).field("tags.keyword").size(10).subAggregation(childrenAgg);
    SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
    searchSourceBuilder.size(0).aggregation(termsAgg);
    SearchRequest searchRequest = new SearchRequest(indexName);
    searchRequest.source(searchSourceBuilder);
    SearchResponse searchResponse = execute(searchRequest, highLevelClient()::search, highLevelClient()::searchAsync);
    assertSearchHeader(searchResponse);
    assertNull(searchResponse.getSuggest());
    assertEquals(Collections.emptyMap(), searchResponse.getProfileResults());
    assertEquals(3, searchResponse.getHits().getTotalHits().value);
    assertEquals(0, searchResponse.getHits().getHits().length);
    assertEquals(Float.NaN, searchResponse.getHits().getMaxScore(), 0f);
    assertEquals(1, searchResponse.getAggregations().asList().size());
    Terms terms = searchResponse.getAggregations().get("top-tags");
    assertEquals(0, terms.getDocCountError());
    assertEquals(0, terms.getSumOfOtherDocCounts());
    assertEquals(3, terms.getBuckets().size());
    for (Terms.Bucket bucket : terms.getBuckets()) {
        assertThat(bucket.getKeyAsString(), either(equalTo("file-transfer")).or(equalTo("windows-server-2003")).or(equalTo("windows-server-2008")));
        assertEquals(1, bucket.getDocCount());
        assertEquals(1, bucket.getAggregations().asList().size());
        Children children = bucket.getAggregations().get("to-answers");
        assertEquals(2, children.getDocCount());
        assertEquals(1, children.getAggregations().asList().size());
        Terms leafTerms = children.getAggregations().get("top-names");
        assertEquals(0, leafTerms.getDocCountError());
        assertEquals(0, leafTerms.getSumOfOtherDocCounts());
        assertEquals(2, leafTerms.getBuckets().size());
        assertEquals(2, leafTerms.getBuckets().size());
        Terms.Bucket sam = leafTerms.getBucketByKey("Sam");
        assertEquals(1, sam.getDocCount());
        Terms.Bucket troll = leafTerms.getBucketByKey("Troll");
        assertEquals(1, troll.getDocCount());
    }
}
Also used : MultiSearchRequest(org.opensearch.action.search.MultiSearchRequest) SearchRequest(org.opensearch.action.search.SearchRequest) RareTermsAggregationBuilder(org.opensearch.search.aggregations.bucket.terms.RareTermsAggregationBuilder) TermsAggregationBuilder(org.opensearch.search.aggregations.bucket.terms.TermsAggregationBuilder) CountRequest(org.opensearch.client.core.CountRequest) FieldCapabilitiesRequest(org.opensearch.action.fieldcaps.FieldCapabilitiesRequest) SearchTemplateRequest(org.opensearch.script.mustache.SearchTemplateRequest) MultiSearchRequest(org.opensearch.action.search.MultiSearchRequest) SearchScrollRequest(org.opensearch.action.search.SearchScrollRequest) ExplainRequest(org.opensearch.action.explain.ExplainRequest) SearchRequest(org.opensearch.action.search.SearchRequest) MultiSearchTemplateRequest(org.opensearch.script.mustache.MultiSearchTemplateRequest) ClearScrollRequest(org.opensearch.action.search.ClearScrollRequest) RareTerms(org.opensearch.search.aggregations.bucket.terms.RareTerms) Terms(org.opensearch.search.aggregations.bucket.terms.Terms) Matchers.containsString(org.hamcrest.Matchers.containsString) Children(org.opensearch.join.aggregations.Children) ChildrenAggregationBuilder(org.opensearch.join.aggregations.ChildrenAggregationBuilder) SearchSourceBuilder(org.opensearch.search.builder.SearchSourceBuilder) MultiSearchResponse(org.opensearch.action.search.MultiSearchResponse) SearchResponse(org.opensearch.action.search.SearchResponse)

Example 99 with SearchRequest

use of org.opensearch.action.search.SearchRequest in project OpenSearch by opensearch-project.

the class SearchIT method testMultiSearch_withQuery.

public void testMultiSearch_withQuery() throws Exception {
    MultiSearchRequest multiSearchRequest = new MultiSearchRequest();
    SearchRequest searchRequest1 = new SearchRequest("index1");
    searchRequest1.source().query(new TermsQueryBuilder("field", "value2"));
    multiSearchRequest.add(searchRequest1);
    SearchRequest searchRequest2 = new SearchRequest("index2");
    searchRequest2.source().query(new TermsQueryBuilder("field", "value2"));
    multiSearchRequest.add(searchRequest2);
    SearchRequest searchRequest3 = new SearchRequest("index3");
    searchRequest3.source().query(new TermsQueryBuilder("field", "value2"));
    multiSearchRequest.add(searchRequest3);
    MultiSearchResponse multiSearchResponse = execute(multiSearchRequest, highLevelClient()::msearch, highLevelClient()::msearchAsync);
    assertThat(multiSearchResponse.getTook().millis(), Matchers.greaterThanOrEqualTo(0L));
    assertThat(multiSearchResponse.getResponses().length, Matchers.equalTo(3));
    assertThat(multiSearchResponse.getResponses()[0].getFailure(), Matchers.nullValue());
    assertThat(multiSearchResponse.getResponses()[0].isFailure(), Matchers.is(false));
    SearchIT.assertSearchHeader(multiSearchResponse.getResponses()[0].getResponse());
    assertThat(multiSearchResponse.getResponses()[0].getResponse().getHits().getTotalHits().value, Matchers.equalTo(1L));
    assertThat(multiSearchResponse.getResponses()[0].getResponse().getHits().getAt(0).getId(), Matchers.equalTo("2"));
    assertThat(multiSearchResponse.getResponses()[1].getFailure(), Matchers.nullValue());
    assertThat(multiSearchResponse.getResponses()[1].isFailure(), Matchers.is(false));
    SearchIT.assertSearchHeader(multiSearchResponse.getResponses()[1].getResponse());
    assertThat(multiSearchResponse.getResponses()[1].getResponse().getHits().getTotalHits().value, Matchers.equalTo(1L));
    assertThat(multiSearchResponse.getResponses()[1].getResponse().getHits().getAt(0).getId(), Matchers.equalTo("4"));
    assertThat(multiSearchResponse.getResponses()[2].getFailure(), Matchers.nullValue());
    assertThat(multiSearchResponse.getResponses()[2].isFailure(), Matchers.is(false));
    SearchIT.assertSearchHeader(multiSearchResponse.getResponses()[2].getResponse());
    assertThat(multiSearchResponse.getResponses()[2].getResponse().getHits().getTotalHits().value, Matchers.equalTo(1L));
    assertThat(multiSearchResponse.getResponses()[2].getResponse().getHits().getAt(0).getId(), Matchers.equalTo("6"));
    searchRequest1.source().highlighter(new HighlightBuilder().field("field"));
    searchRequest2.source().highlighter(new HighlightBuilder().field("field"));
    searchRequest3.source().highlighter(new HighlightBuilder().field("field"));
    multiSearchResponse = execute(multiSearchRequest, highLevelClient()::msearch, highLevelClient()::msearchAsync);
    assertThat(multiSearchResponse.getTook().millis(), Matchers.greaterThanOrEqualTo(0L));
    assertThat(multiSearchResponse.getResponses().length, Matchers.equalTo(3));
    assertThat(multiSearchResponse.getResponses()[0].getFailure(), Matchers.nullValue());
    assertThat(multiSearchResponse.getResponses()[0].isFailure(), Matchers.is(false));
    SearchIT.assertSearchHeader(multiSearchResponse.getResponses()[0].getResponse());
    assertThat(multiSearchResponse.getResponses()[0].getResponse().getHits().getTotalHits().value, Matchers.equalTo(1L));
    assertThat(multiSearchResponse.getResponses()[0].getResponse().getHits().getAt(0).getHighlightFields().get("field").fragments()[0].string(), Matchers.equalTo("<em>value2</em>"));
    assertThat(multiSearchResponse.getResponses()[1].getFailure(), Matchers.nullValue());
    assertThat(multiSearchResponse.getResponses()[1].isFailure(), Matchers.is(false));
    SearchIT.assertSearchHeader(multiSearchResponse.getResponses()[1].getResponse());
    assertThat(multiSearchResponse.getResponses()[1].getResponse().getHits().getTotalHits().value, Matchers.equalTo(1L));
    assertThat(multiSearchResponse.getResponses()[1].getResponse().getHits().getAt(0).getId(), Matchers.equalTo("4"));
    assertThat(multiSearchResponse.getResponses()[1].getResponse().getHits().getAt(0).getHighlightFields().get("field").fragments()[0].string(), Matchers.equalTo("<em>value2</em>"));
    assertThat(multiSearchResponse.getResponses()[2].getFailure(), Matchers.nullValue());
    assertThat(multiSearchResponse.getResponses()[2].isFailure(), Matchers.is(false));
    SearchIT.assertSearchHeader(multiSearchResponse.getResponses()[2].getResponse());
    assertThat(multiSearchResponse.getResponses()[2].getResponse().getHits().getTotalHits().value, Matchers.equalTo(1L));
    assertThat(multiSearchResponse.getResponses()[2].getResponse().getHits().getAt(0).getId(), Matchers.equalTo("6"));
    assertThat(multiSearchResponse.getResponses()[2].getResponse().getHits().getAt(0).getHighlightFields().get("field").fragments()[0].string(), Matchers.equalTo("<em>value2</em>"));
}
Also used : MultiSearchRequest(org.opensearch.action.search.MultiSearchRequest) SearchRequest(org.opensearch.action.search.SearchRequest) MultiSearchResponse(org.opensearch.action.search.MultiSearchResponse) TermsQueryBuilder(org.opensearch.index.query.TermsQueryBuilder) MultiSearchRequest(org.opensearch.action.search.MultiSearchRequest) HighlightBuilder(org.opensearch.search.fetch.subphase.highlight.HighlightBuilder)

Example 100 with SearchRequest

use of org.opensearch.action.search.SearchRequest in project OpenSearch by opensearch-project.

the class SearchIT method testNonExistentSearchTemplate.

public void testNonExistentSearchTemplate() {
    SearchTemplateRequest searchTemplateRequest = new SearchTemplateRequest();
    searchTemplateRequest.setRequest(new SearchRequest("index"));
    searchTemplateRequest.setScriptType(ScriptType.STORED);
    searchTemplateRequest.setScript("non-existent");
    searchTemplateRequest.setScriptParams(Collections.emptyMap());
    OpenSearchStatusException exception = expectThrows(OpenSearchStatusException.class, () -> execute(searchTemplateRequest, highLevelClient()::searchTemplate, highLevelClient()::searchTemplateAsync));
    assertEquals(RestStatus.NOT_FOUND, exception.status());
}
Also used : MultiSearchRequest(org.opensearch.action.search.MultiSearchRequest) SearchRequest(org.opensearch.action.search.SearchRequest) SearchTemplateRequest(org.opensearch.script.mustache.SearchTemplateRequest) MultiSearchTemplateRequest(org.opensearch.script.mustache.MultiSearchTemplateRequest) OpenSearchStatusException(org.opensearch.OpenSearchStatusException)

Aggregations

SearchRequest (org.opensearch.action.search.SearchRequest)407 SearchSourceBuilder (org.opensearch.search.builder.SearchSourceBuilder)213 SearchResponse (org.opensearch.action.search.SearchResponse)149 SubmitAsynchronousSearchRequest (org.opensearch.search.asynchronous.request.SubmitAsynchronousSearchRequest)91 ActionListener (org.opensearch.action.ActionListener)77 IOException (java.io.IOException)76 List (java.util.List)68 ClusterService (org.opensearch.cluster.service.ClusterService)67 ArrayList (java.util.ArrayList)64 TimeValue (org.opensearch.common.unit.TimeValue)62 AsynchronousSearchResponse (org.opensearch.search.asynchronous.response.AsynchronousSearchResponse)62 MultiSearchRequest (org.opensearch.action.search.MultiSearchRequest)61 Map (java.util.Map)55 CountDownLatch (java.util.concurrent.CountDownLatch)55 BoolQueryBuilder (org.opensearch.index.query.BoolQueryBuilder)52 HashMap (java.util.HashMap)51 Client (org.opensearch.client.Client)48 DiscoveryNode (org.opensearch.cluster.node.DiscoveryNode)48 Settings (org.opensearch.common.settings.Settings)46 DeleteAsynchronousSearchRequest (org.opensearch.search.asynchronous.request.DeleteAsynchronousSearchRequest)46