Search in sources :

Example 1 with GetIndicesSettingsResponse

use of co.elastic.clients.elasticsearch.indices.GetIndicesSettingsResponse in project elasticsearch-java by elastic.

the class RequestTest method testDefaultIndexSettings.

@Test
public void testDefaultIndexSettings() throws IOException {
    // https://github.com/elastic/elasticsearch-java/issues/46
    String index = "index-settings";
    client.index(_1 -> _1.index(index).document(new Product(5)).refresh(Refresh.True));
    GetIndicesSettingsResponse settings;
    settings = client.indices().getSettings(b -> b.index(index).includeDefaults(true));
    assertNotNull(settings.get(index).defaults());
    settings = client.indices().getSettings(b -> b.index(index));
    assertNull(settings.get(index).defaults());
}
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) GetIndicesSettingsResponse(co.elastic.clients.elasticsearch.indices.GetIndicesSettingsResponse) Test(org.junit.Test)

Aggregations

ElasticsearchAsyncClient (co.elastic.clients.elasticsearch.ElasticsearchAsyncClient)1 ElasticsearchClient (co.elastic.clients.elasticsearch.ElasticsearchClient)1 ElasticsearchTestServer (co.elastic.clients.elasticsearch.ElasticsearchTestServer)1 ElasticsearchException (co.elastic.clients.elasticsearch._types.ElasticsearchException)1 Refresh (co.elastic.clients.elasticsearch._types.Refresh)1 HistogramAggregate (co.elastic.clients.elasticsearch._types.aggregations.HistogramAggregate)1 Property (co.elastic.clients.elasticsearch._types.mapping.Property)1 NodesResponse (co.elastic.clients.elasticsearch.cat.NodesResponse)1 BulkResponse (co.elastic.clients.elasticsearch.core.BulkResponse)1 ClearScrollResponse (co.elastic.clients.elasticsearch.core.ClearScrollResponse)1 ClosePointInTimeResponse (co.elastic.clients.elasticsearch.core.ClosePointInTimeResponse)1 GetResponse (co.elastic.clients.elasticsearch.core.GetResponse)1 IndexResponse (co.elastic.clients.elasticsearch.core.IndexResponse)1 MsearchResponse (co.elastic.clients.elasticsearch.core.MsearchResponse)1 SearchResponse (co.elastic.clients.elasticsearch.core.SearchResponse)1 OperationType (co.elastic.clients.elasticsearch.core.bulk.OperationType)1 RequestItem (co.elastic.clients.elasticsearch.core.msearch.RequestItem)1 CreateIndexResponse (co.elastic.clients.elasticsearch.indices.CreateIndexResponse)1 DiskUsageResponse (co.elastic.clients.elasticsearch.indices.DiskUsageResponse)1 GetIndexResponse (co.elastic.clients.elasticsearch.indices.GetIndexResponse)1