Search in sources :

Example 1 with GetIndicesSettingsResponse

use of org.opensearch.client.opensearch.indices.GetIndicesSettingsResponse 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)

Aggregations

IOException (java.io.IOException)1 Collections (java.util.Collections)1 Map (java.util.Map)1 CompletableFuture (java.util.concurrent.CompletableFuture)1 ExecutionException (java.util.concurrent.ExecutionException)1 TimeUnit (java.util.concurrent.TimeUnit)1 Test (org.junit.Test)1 OpenSearchAsyncClient (org.opensearch.client.opensearch.OpenSearchAsyncClient)1 OpenSearchException (org.opensearch.client.opensearch._types.OpenSearchException)1 Refresh (org.opensearch.client.opensearch._types.Refresh)1 HistogramAggregate (org.opensearch.client.opensearch._types.aggregations.HistogramAggregate)1 Property (org.opensearch.client.opensearch._types.mapping.Property)1 NodesResponse (org.opensearch.client.opensearch.cat.NodesResponse)1 BulkResponse (org.opensearch.client.opensearch.core.BulkResponse)1 ClearScrollResponse (org.opensearch.client.opensearch.core.ClearScrollResponse)1 GetResponse (org.opensearch.client.opensearch.core.GetResponse)1 IndexResponse (org.opensearch.client.opensearch.core.IndexResponse)1 MsearchResponse (org.opensearch.client.opensearch.core.MsearchResponse)1 SearchResponse (org.opensearch.client.opensearch.core.SearchResponse)1 OperationType (org.opensearch.client.opensearch.core.bulk.OperationType)1