Search in sources :

Example 1 with Refresh

use of co.elastic.clients.elasticsearch._types.Refresh in project opensearch-java by opensearch-project.

the class RequestTest method testDataIngestion.

@Test
public void testDataIngestion() throws Exception {
    String index = "ingest-test";
    // Create an index
    CreateIndexResponse createIndexResponse = highLevelClient().indices().create(b -> b.index(index));
    assertEquals(index, createIndexResponse.index());
    // Check that it actually exists. Example of a boolean response
    BooleanResponse existsResponse = highLevelClient().indices().exists(b -> b.index(index));
    assertTrue(existsResponse.value());
    // Ingest some data
    AppData appData = new AppData();
    appData.setIntValue(1337);
    appData.setMsg("foo");
    String docId = highLevelClient().index(b -> b.index(index).id(// test with url-unsafe string
    "my/Id").document(appData).refresh(// Make it visible for search
    Refresh.True)).id();
    assertEquals("my/Id", docId);
    // Check auto-created mapping
    GetMappingResponse mapping = highLevelClient().indices().getMapping(b -> b.index(index));
    assertEquals(Property.Kind.Long, mapping.get("ingest-test").mappings().properties().get("intValue")._kind());
    // Query by id
    AppData esData = highLevelClient().get(b -> b.index(index).id(docId), AppData.class).source();
    assertEquals(1337, esData.getIntValue());
    assertEquals("foo", esData.getMsg());
    // Query by id a non-existing document
    final GetResponse<AppData> notExists = highLevelClient().get(b -> b.index(index).id("some-random-id"), AppData.class);
    assertFalse(notExists.found());
    assertNull(notExists.source());
    // Search
    SearchResponse<AppData> search = highLevelClient().search(b -> b.index(index), AppData.class);
    long hits = search.hits().total().value();
    assertEquals(1, hits);
    esData = search.hits().hits().get(0).source();
    assertEquals(1337, esData.getIntValue());
    assertEquals("foo", esData.getMsg());
    RequestItem item = RequestItem.of(_1 -> _1.header(_2 -> _2.index("test")).body(_2 -> _2.size(4)));
    // MSearch: 1st search on an existing index, 2nd one on a non-existing index
    final MsearchResponse<AppData> msearch = highLevelClient().msearch(_0 -> _0.searches(_1 -> _1.header(_3 -> _3.index(index)).body(_3 -> _3.query(_4 -> _4.matchAll(_5 -> _5)))).searches(_1 -> _1.header(_3 -> _3.index("non-existing")).body(_3 -> _3.query(_4 -> _4.matchAll(_5 -> _5)))), AppData.class);
    assertEquals(2, msearch.responses().size());
    assertTrue(msearch.responses().get(0).isResult());
    assertEquals(1, msearch.responses().get(0).result().hits().hits().size());
    assertTrue(msearch.responses().get(1).isFailure());
    assertEquals(404, msearch.responses().get(1).failure().status());
}
Also used : CompletableFuture(java.util.concurrent.CompletableFuture) CreateIndexResponse(org.opensearch.client.opensearch.indices.CreateIndexResponse) GetMappingResponse(org.opensearch.client.opensearch.indices.GetMappingResponse) HistogramAggregate(org.opensearch.client.opensearch._types.aggregations.HistogramAggregate) OperationType(org.opensearch.client.opensearch.core.bulk.OperationType) Property(org.opensearch.client.opensearch._types.mapping.Property) IndexResponse(org.opensearch.client.opensearch.core.IndexResponse) Map(java.util.Map) Refresh(org.opensearch.client.opensearch._types.Refresh) GetIndexResponse(org.opensearch.client.opensearch.indices.GetIndexResponse) OpenSearchAsyncClient(org.opensearch.client.opensearch.OpenSearchAsyncClient) BooleanResponse(org.opensearch.client.transport.endpoints.BooleanResponse) RequestItem(org.opensearch.client.opensearch.core.msearch.RequestItem) OpenSearchException(org.opensearch.client.opensearch._types.OpenSearchException) IndexState(org.opensearch.client.opensearch.indices.IndexState) Test(org.junit.Test) IOException(java.io.IOException) BulkResponse(org.opensearch.client.opensearch.core.BulkResponse) SearchResponse(org.opensearch.client.opensearch.core.SearchResponse) ClearScrollResponse(org.opensearch.client.opensearch.core.ClearScrollResponse) MsearchResponse(org.opensearch.client.opensearch.core.MsearchResponse) GetIndicesSettingsResponse(org.opensearch.client.opensearch.indices.GetIndicesSettingsResponse) ModelTestCase(org.opensearch.client.opensearch.model.ModelTestCase) ExecutionException(java.util.concurrent.ExecutionException) TimeUnit(java.util.concurrent.TimeUnit) NodesResponse(org.opensearch.client.opensearch.cat.NodesResponse) GetResponse(org.opensearch.client.opensearch.core.GetResponse) Collections(java.util.Collections) RequestItem(org.opensearch.client.opensearch.core.msearch.RequestItem) GetMappingResponse(org.opensearch.client.opensearch.indices.GetMappingResponse) CreateIndexResponse(org.opensearch.client.opensearch.indices.CreateIndexResponse) BooleanResponse(org.opensearch.client.transport.endpoints.BooleanResponse) Test(org.junit.Test)

Example 2 with Refresh

use of co.elastic.clients.elasticsearch._types.Refresh in project opensearch-java by opensearch-project.

the class RequestTest method testSearchAggregation.

@Test
public void testSearchAggregation() throws IOException {
    highLevelClient().create(_1 -> _1.index("products").id("A").document(new Product(5)).refresh(Refresh.True));
    highLevelClient().create(_1 -> _1.index("products").id("B").document(new Product(15)).refresh(Refresh.True));
    highLevelClient().create(_1 -> _1.index("products").id("C").document(new Product(25)).refresh(Refresh.True));
    SearchResponse<Product> searchResponse = highLevelClient().search(_1 -> _1.index("products").size(0).aggregations("prices", _3 -> _3.histogram(_4 -> _4.field("price").interval(10.0)).aggregations("average", _5 -> _5.avg(_6 -> _6.field("price")))), Product.class);
    HistogramAggregate prices = searchResponse.aggregations().get("prices").histogram();
    assertEquals(3, prices.buckets().array().size());
    assertEquals(1, prices.buckets().array().get(0).docCount());
    assertEquals(5.0, prices.buckets().array().get(0).aggregations().get("average").avg().value(), 0.01);
    // We've set "size" to zero
    assertEquals(0, searchResponse.hits().hits().size());
}
Also used : CompletableFuture(java.util.concurrent.CompletableFuture) CreateIndexResponse(org.opensearch.client.opensearch.indices.CreateIndexResponse) GetMappingResponse(org.opensearch.client.opensearch.indices.GetMappingResponse) HistogramAggregate(org.opensearch.client.opensearch._types.aggregations.HistogramAggregate) OperationType(org.opensearch.client.opensearch.core.bulk.OperationType) Property(org.opensearch.client.opensearch._types.mapping.Property) IndexResponse(org.opensearch.client.opensearch.core.IndexResponse) Map(java.util.Map) Refresh(org.opensearch.client.opensearch._types.Refresh) GetIndexResponse(org.opensearch.client.opensearch.indices.GetIndexResponse) OpenSearchAsyncClient(org.opensearch.client.opensearch.OpenSearchAsyncClient) BooleanResponse(org.opensearch.client.transport.endpoints.BooleanResponse) RequestItem(org.opensearch.client.opensearch.core.msearch.RequestItem) OpenSearchException(org.opensearch.client.opensearch._types.OpenSearchException) IndexState(org.opensearch.client.opensearch.indices.IndexState) Test(org.junit.Test) IOException(java.io.IOException) BulkResponse(org.opensearch.client.opensearch.core.BulkResponse) SearchResponse(org.opensearch.client.opensearch.core.SearchResponse) ClearScrollResponse(org.opensearch.client.opensearch.core.ClearScrollResponse) MsearchResponse(org.opensearch.client.opensearch.core.MsearchResponse) GetIndicesSettingsResponse(org.opensearch.client.opensearch.indices.GetIndicesSettingsResponse) ModelTestCase(org.opensearch.client.opensearch.model.ModelTestCase) ExecutionException(java.util.concurrent.ExecutionException) TimeUnit(java.util.concurrent.TimeUnit) NodesResponse(org.opensearch.client.opensearch.cat.NodesResponse) GetResponse(org.opensearch.client.opensearch.core.GetResponse) Collections(java.util.Collections) HistogramAggregate(org.opensearch.client.opensearch._types.aggregations.HistogramAggregate) Test(org.junit.Test)

Example 3 with Refresh

use of co.elastic.clients.elasticsearch._types.Refresh in project para-search-elasticsearch by Erudika.

the class ESUtils method executeRequests.

/**
 * Executes a batch of write requests.
 * @param requests a list of index/delete requests,
 */
public static void executeRequests(List<BulkOperation> requests) {
    if (requests == null || requests.isEmpty()) {
        return;
    }
    try {
        if (asyncEnabled()) {
            getAsyncRESTClient().bulk(b -> b.operations(requests).refresh(flushImmediately() ? Refresh.True : Refresh.False)).thenAccept(b -> {
                if (b.errors()) {
                    b.items().stream().filter(i -> i.status() != 200).forEach(item -> {
                        // FUTURE: Increment counter metric for failed document indexing
                        logger.error("Failed to execute async {} operation for index '{}', document id '{}': ", item.operationType(), item.index(), item.id(), item.error().reason());
                    });
                }
            });
        } else {
            BulkResponse res = getRESTClient().bulk(b -> b.operations(requests).refresh(flushImmediately() ? Refresh.True : Refresh.False));
            if (res.errors()) {
                res.items().stream().filter(i -> i.status() != 200).forEach(item -> {
                    // FUTURE: Increment counter metric for failed document indexing
                    logger.error("Failed to execute sync {} operation for index '{}', document id '{}': ", item.operationType(), item.index(), item.id(), item.error().reason());
                });
                handleFailedRequests();
            }
        }
    } catch (Exception e) {
        logger.error(null, e);
    }
}
Also used : Query(org.apache.lucene.search.Query) BulkOperation(co.elastic.clients.elasticsearch.core.bulk.BulkOperation) RestClientBuilder(org.elasticsearch.client.RestClientBuilder) Term(org.apache.lucene.index.Term) LoggerFactory(org.slf4j.LoggerFactory) TrackHits(co.elastic.clients.elasticsearch.core.search.TrackHits) StringUtils(org.apache.commons.lang3.StringUtils) Header(org.apache.http.Header) BasicCredentialsProvider(org.apache.http.impl.client.BasicCredentialsProvider) Matcher(java.util.regex.Matcher) Map(java.util.Map) FieldValue(co.elastic.clients.elasticsearch._types.FieldValue) DestroyListener(com.erudika.para.core.listeners.DestroyListener) Config(com.erudika.para.core.utils.Config) Conflicts(co.elastic.clients.elasticsearch._types.Conflicts) JsonData(co.elastic.clients.json.JsonData) ParaObject(com.erudika.para.core.ParaObject) URIBuilder(org.apache.http.client.utils.URIBuilder) HttpEntity(org.apache.http.HttpEntity) PrefixQuery(org.apache.lucene.search.PrefixQuery) AddAction(co.elastic.clients.elasticsearch.indices.update_aliases.AddAction) FuzzyQuery(org.apache.lucene.search.FuzzyQuery) DefaultCredentialsProvider(software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider) TypeMapping(co.elastic.clients.elasticsearch._types.mapping.TypeMapping) HttpRequest(org.apache.http.HttpRequest) WildcardQuery(org.apache.lucene.search.WildcardQuery) Objects(java.util.Objects) QueryNodeException(org.apache.lucene.queryparser.flexible.core.QueryNodeException) List(java.util.List) HttpAsyncClientBuilder(org.apache.http.impl.nio.client.HttpAsyncClientBuilder) ObjectBuilder(co.elastic.clients.util.ObjectBuilder) BulkResponse(co.elastic.clients.elasticsearch.core.BulkResponse) Entry(java.util.Map.Entry) Para(com.erudika.para.core.utils.Para) Pattern(java.util.regex.Pattern) HealthStatus(co.elastic.clients.elasticsearch._types.HealthStatus) QueryBuilders(co.elastic.clients.elasticsearch._types.query_dsl.QueryBuilders) NameValuePair(org.apache.http.NameValuePair) CredentialsProvider(org.apache.http.client.CredentialsProvider) JacksonJsonpMapper(co.elastic.clients.json.jackson.JacksonJsonpMapper) App(com.erudika.para.core.App) ElasticsearchAsyncClient(co.elastic.clients.elasticsearch.ElasticsearchAsyncClient) RestClientTransport(co.elastic.clients.transport.rest_client.RestClientTransport) Sysprop(com.erudika.para.core.Sysprop) RestClient(org.elasticsearch.client.RestClient) IndexAliases(co.elastic.clients.elasticsearch.indices.get_alias.IndexAliases) ParaObjectUtils(com.erudika.para.core.utils.ParaObjectUtils) Aws4SignerParams(software.amazon.awssdk.auth.signer.params.Aws4SignerParams) HashMap(java.util.HashMap) ChildScoreMode(co.elastic.clients.elasticsearch._types.query_dsl.ChildScoreMode) Pager(com.erudika.para.core.utils.Pager) DeleteByQueryResponse(co.elastic.clients.elasticsearch.core.DeleteByQueryResponse) ArrayList(java.util.ArrayList) DeleteByQueryRequest(co.elastic.clients.elasticsearch.core.DeleteByQueryRequest) Action(co.elastic.clients.elasticsearch.indices.update_aliases.Action) DAO(com.erudika.para.core.persistence.DAO) SdkHttpMethod(software.amazon.awssdk.http.SdkHttpMethod) SdkHttpFullRequest(software.amazon.awssdk.http.SdkHttpFullRequest) LinkedList(java.util.LinkedList) Region(software.amazon.awssdk.regions.Region) BoolQuery(co.elastic.clients.elasticsearch._types.query_dsl.BoolQuery) Property(co.elastic.clients.elasticsearch._types.mapping.Property) Refresh(co.elastic.clients.elasticsearch._types.Refresh) HttpEntityEnclosingRequest(org.apache.http.HttpEntityEnclosingRequest) Time(co.elastic.clients.elasticsearch._types.Time) Logger(org.slf4j.Logger) SortOrder(co.elastic.clients.elasticsearch._types.SortOrder) Aws4Signer(software.amazon.awssdk.auth.signer.Aws4Signer) AwsCredentials(software.amazon.awssdk.auth.credentials.AwsCredentials) StandardQueryParser(org.apache.lucene.queryparser.flexible.standard.StandardQueryParser) IndexSettings(co.elastic.clients.elasticsearch.indices.IndexSettings) IOException(java.io.IOException) Utils(com.erudika.para.core.utils.Utils) BooleanClause(org.apache.lucene.search.BooleanClause) Operator(co.elastic.clients.elasticsearch._types.query_dsl.Operator) Consumer(java.util.function.Consumer) UsernamePasswordCredentials(org.apache.http.auth.UsernamePasswordCredentials) BooleanQuery(org.apache.lucene.search.BooleanQuery) AuthScope(org.apache.http.auth.AuthScope) HttpContext(org.apache.http.protocol.HttpContext) BoostQuery(org.apache.lucene.search.BoostQuery) TermRangeQuery(org.apache.lucene.search.TermRangeQuery) NumberUtils(org.apache.commons.lang3.math.NumberUtils) MatchAllQuery(co.elastic.clients.elasticsearch._types.query_dsl.MatchAllQuery) ElasticsearchClient(co.elastic.clients.elasticsearch.ElasticsearchClient) QueryVariant(co.elastic.clients.elasticsearch._types.query_dsl.QueryVariant) SortOptions(co.elastic.clients.elasticsearch._types.SortOptions) RemoveAction(co.elastic.clients.elasticsearch.indices.update_aliases.RemoveAction) Collections(java.util.Collections) HttpHost(org.apache.http.HttpHost) RangeQuery(co.elastic.clients.elasticsearch._types.query_dsl.RangeQuery) InputStream(java.io.InputStream) BulkResponse(co.elastic.clients.elasticsearch.core.BulkResponse) QueryNodeException(org.apache.lucene.queryparser.flexible.core.QueryNodeException) IOException(java.io.IOException)

Example 4 with Refresh

use of co.elastic.clients.elasticsearch._types.Refresh in project opensearch-java by opensearch-project.

the class RequestTest method testDefaultIndexSettings.

@Test
public void testDefaultIndexSettings() throws IOException {
    String index = "index-settings";
    highLevelClient().index(_1 -> _1.index(index).document(new Product(5)).refresh(Refresh.True));
    GetIndicesSettingsResponse settings;
    settings = highLevelClient().indices().getSettings(b -> b.index(index).includeDefaults(true));
    assertNotNull(settings.get(index).defaults());
    settings = highLevelClient().indices().getSettings(b -> b.index(index));
    assertNull(settings.get(index).defaults());
}
Also used : CompletableFuture(java.util.concurrent.CompletableFuture) CreateIndexResponse(org.opensearch.client.opensearch.indices.CreateIndexResponse) GetMappingResponse(org.opensearch.client.opensearch.indices.GetMappingResponse) HistogramAggregate(org.opensearch.client.opensearch._types.aggregations.HistogramAggregate) OperationType(org.opensearch.client.opensearch.core.bulk.OperationType) Property(org.opensearch.client.opensearch._types.mapping.Property) IndexResponse(org.opensearch.client.opensearch.core.IndexResponse) Map(java.util.Map) Refresh(org.opensearch.client.opensearch._types.Refresh) GetIndexResponse(org.opensearch.client.opensearch.indices.GetIndexResponse) OpenSearchAsyncClient(org.opensearch.client.opensearch.OpenSearchAsyncClient) BooleanResponse(org.opensearch.client.transport.endpoints.BooleanResponse) RequestItem(org.opensearch.client.opensearch.core.msearch.RequestItem) OpenSearchException(org.opensearch.client.opensearch._types.OpenSearchException) IndexState(org.opensearch.client.opensearch.indices.IndexState) Test(org.junit.Test) IOException(java.io.IOException) BulkResponse(org.opensearch.client.opensearch.core.BulkResponse) SearchResponse(org.opensearch.client.opensearch.core.SearchResponse) ClearScrollResponse(org.opensearch.client.opensearch.core.ClearScrollResponse) MsearchResponse(org.opensearch.client.opensearch.core.MsearchResponse) GetIndicesSettingsResponse(org.opensearch.client.opensearch.indices.GetIndicesSettingsResponse) ModelTestCase(org.opensearch.client.opensearch.model.ModelTestCase) ExecutionException(java.util.concurrent.ExecutionException) TimeUnit(java.util.concurrent.TimeUnit) NodesResponse(org.opensearch.client.opensearch.cat.NodesResponse) GetResponse(org.opensearch.client.opensearch.core.GetResponse) Collections(java.util.Collections) GetIndicesSettingsResponse(org.opensearch.client.opensearch.indices.GetIndicesSettingsResponse) Test(org.junit.Test)

Example 5 with Refresh

use of co.elastic.clients.elasticsearch._types.Refresh in project elasticsearch-java by elastic.

the class RequestTest method testDataIngestion.

@Test
public void testDataIngestion() throws Exception {
    String index = "ingest-test";
    // Create an index
    CreateIndexResponse createIndexResponse = client.indices().create(b -> b.index(index));
    assertEquals(index, createIndexResponse.index());
    // Check that it actually exists. Example of a boolean response
    BooleanResponse existsResponse = client.indices().exists(b -> b.index(index));
    assertTrue(existsResponse.value());
    // Ingest some data
    AppData appData = new AppData();
    appData.setIntValue(1337);
    appData.setMsg("foo");
    String docId = client.index(b -> b.index(index).id(// test with url-unsafe string
    "my/Id").document(appData).refresh(// Make it visible for search
    Refresh.True)).id();
    assertEquals("my/Id", docId);
    // Check auto-created mapping
    GetMappingResponse mapping = client.indices().getMapping(b -> b.index(index));
    assertEquals(Property.Kind.Long, mapping.get("ingest-test").mappings().properties().get("intValue")._kind());
    // Query by id
    AppData esData = client.get(b -> b.index(index).id(docId), AppData.class).source();
    assertEquals(1337, esData.getIntValue());
    assertEquals("foo", esData.getMsg());
    // Query by id a non-existing document
    final GetResponse<AppData> notExists = client.get(b -> b.index(index).id("some-random-id"), AppData.class);
    assertFalse(notExists.found());
    assertNull(notExists.source());
    // Search
    SearchResponse<AppData> search = client.search(b -> b.index(index), AppData.class);
    long hits = search.hits().total().value();
    assertEquals(1, hits);
    esData = search.hits().hits().get(0).source();
    assertEquals(1337, esData.getIntValue());
    assertEquals("foo", esData.getMsg());
    RequestItem item = RequestItem.of(_1 -> _1.header(_2 -> _2.index("test")).body(_2 -> _2.size(4)));
    // MSearch: 1st search on an existing index, 2nd one on a non-existing index
    final MsearchResponse<AppData> msearch = client.msearch(_0 -> _0.searches(_1 -> _1.header(_3 -> _3.index(index)).body(_3 -> _3.query(_4 -> _4.matchAll(_5 -> _5)))).searches(_1 -> _1.header(_3 -> _3.index("non-existing")).body(_3 -> _3.query(_4 -> _4.matchAll(_5 -> _5)))), AppData.class);
    assertEquals(2, msearch.responses().size());
    assertTrue(msearch.responses().get(0).isResult());
    assertEquals(1, msearch.responses().get(0).result().hits().hits().size());
    assertTrue(msearch.responses().get(1).isFailure());
    assertEquals(404, msearch.responses().get(1).failure().status());
}
Also used : CreateIndexResponse(co.elastic.clients.elasticsearch.indices.CreateIndexResponse) SearchResponse(co.elastic.clients.elasticsearch.core.SearchResponse) BeforeClass(org.junit.BeforeClass) RequestItem(co.elastic.clients.elasticsearch.core.msearch.RequestItem) CompletableFuture(java.util.concurrent.CompletableFuture) IndexState(co.elastic.clients.elasticsearch.indices.IndexState) BooleanResponse(co.elastic.clients.transport.endpoints.BooleanResponse) DateTime(co.elastic.clients.util.DateTime) Map(java.util.Map) OperationType(co.elastic.clients.elasticsearch.core.bulk.OperationType) ModelTestCase(co.elastic.clients.elasticsearch.model.ModelTestCase) Property(co.elastic.clients.elasticsearch._types.mapping.Property) Refresh(co.elastic.clients.elasticsearch._types.Refresh) ElasticsearchException(co.elastic.clients.elasticsearch._types.ElasticsearchException) HistogramAggregate(co.elastic.clients.elasticsearch._types.aggregations.HistogramAggregate) NodesResponse(co.elastic.clients.elasticsearch.cat.NodesResponse) GetResponse(co.elastic.clients.elasticsearch.core.GetResponse) ElasticsearchTestServer(co.elastic.clients.elasticsearch.ElasticsearchTestServer) Test(org.junit.Test) IOException(java.io.IOException) GetIndexResponse(co.elastic.clients.elasticsearch.indices.GetIndexResponse) Instant(java.time.Instant) GetIndicesSettingsResponse(co.elastic.clients.elasticsearch.indices.GetIndicesSettingsResponse) GetMappingResponse(co.elastic.clients.elasticsearch.indices.GetMappingResponse) MsearchResponse(co.elastic.clients.elasticsearch.core.MsearchResponse) ExecutionException(java.util.concurrent.ExecutionException) TimeUnit(java.util.concurrent.TimeUnit) ClosePointInTimeResponse(co.elastic.clients.elasticsearch.core.ClosePointInTimeResponse) DateTimeFormatter(java.time.format.DateTimeFormatter) BulkResponse(co.elastic.clients.elasticsearch.core.BulkResponse) ElasticsearchClient(co.elastic.clients.elasticsearch.ElasticsearchClient) DiskUsageResponse(co.elastic.clients.elasticsearch.indices.DiskUsageResponse) ClearScrollResponse(co.elastic.clients.elasticsearch.core.ClearScrollResponse) Assert(org.junit.Assert) Collections(java.util.Collections) IndexResponse(co.elastic.clients.elasticsearch.core.IndexResponse) ElasticsearchAsyncClient(co.elastic.clients.elasticsearch.ElasticsearchAsyncClient) RequestItem(co.elastic.clients.elasticsearch.core.msearch.RequestItem) GetMappingResponse(co.elastic.clients.elasticsearch.indices.GetMappingResponse) CreateIndexResponse(co.elastic.clients.elasticsearch.indices.CreateIndexResponse) BooleanResponse(co.elastic.clients.transport.endpoints.BooleanResponse) Test(org.junit.Test)

Aggregations

IOException (java.io.IOException)7 Collections (java.util.Collections)7 Map (java.util.Map)7 CompletableFuture (java.util.concurrent.CompletableFuture)6 ExecutionException (java.util.concurrent.ExecutionException)6 TimeUnit (java.util.concurrent.TimeUnit)6 Test (org.junit.Test)6 ElasticsearchAsyncClient (co.elastic.clients.elasticsearch.ElasticsearchAsyncClient)4 ElasticsearchClient (co.elastic.clients.elasticsearch.ElasticsearchClient)4 Refresh (co.elastic.clients.elasticsearch._types.Refresh)4 Property (co.elastic.clients.elasticsearch._types.mapping.Property)4 ElasticsearchTestServer (co.elastic.clients.elasticsearch.ElasticsearchTestServer)3 ElasticsearchException (co.elastic.clients.elasticsearch._types.ElasticsearchException)3 HistogramAggregate (co.elastic.clients.elasticsearch._types.aggregations.HistogramAggregate)3 NodesResponse (co.elastic.clients.elasticsearch.cat.NodesResponse)3 BulkResponse (co.elastic.clients.elasticsearch.core.BulkResponse)3 ClearScrollResponse (co.elastic.clients.elasticsearch.core.ClearScrollResponse)3 ClosePointInTimeResponse (co.elastic.clients.elasticsearch.core.ClosePointInTimeResponse)3 GetResponse (co.elastic.clients.elasticsearch.core.GetResponse)3 IndexResponse (co.elastic.clients.elasticsearch.core.IndexResponse)3