diff --git a/samples/src/main/java/org/opensearch/client/samples/IndexingBasics.java b/samples/src/main/java/org/opensearch/client/samples/IndexingBasics.java index 74eb63b2b7..db7bfdf3f6 100644 --- a/samples/src/main/java/org/opensearch/client/samples/IndexingBasics.java +++ b/samples/src/main/java/org/opensearch/client/samples/IndexingBasics.java @@ -48,13 +48,13 @@ public static void main(String[] args) { LOGGER.info("Creating index {}", indexName); IndexSettings settings = new IndexSettings.Builder().numberOfShards("2").numberOfReplicas("1").build(); TypeMapping mapping = new TypeMapping.Builder().properties( - "age", - new Property.Builder().integer(new IntegerNumberProperty.Builder().build()).build() + "age", + new Property.Builder().integer(new IntegerNumberProperty.Builder().build()).build() ).build(); CreateIndexRequest createIndexRequest = new CreateIndexRequest.Builder().index(indexName) - .settings(settings) - .mappings(mapping) - .build(); + .settings(settings) + .mappings(mapping) + .build(); client.indices().create(createIndexRequest); } diff --git a/samples/src/main/java/org/opensearch/client/samples/PointInTime.java b/samples/src/main/java/org/opensearch/client/samples/PointInTime.java index 14ed4bfb5c..53e29743c4 100644 --- a/samples/src/main/java/org/opensearch/client/samples/PointInTime.java +++ b/samples/src/main/java/org/opensearch/client/samples/PointInTime.java @@ -43,13 +43,13 @@ public static void main(String[] args) { LOGGER.info("Creating index {}", indexName); IndexSettings settings = new IndexSettings.Builder().numberOfShards("2").numberOfReplicas("1").build(); TypeMapping mapping = new TypeMapping.Builder().properties( - "age", - new Property.Builder().integer(new IntegerNumberProperty.Builder().build()).build() + "age", + new Property.Builder().integer(new IntegerNumberProperty.Builder().build()).build() ).build(); CreateIndexRequest createIndexRequest = new CreateIndexRequest.Builder().index(indexName) - .settings(settings) - .mappings(mapping) - .build(); + .settings(settings) + .mappings(mapping) + .build(); client.indices().create(createIndexRequest); } diff --git a/samples/src/main/java/org/opensearch/client/samples/Search.java b/samples/src/main/java/org/opensearch/client/samples/Search.java index 31bc62501f..ce357d2942 100644 --- a/samples/src/main/java/org/opensearch/client/samples/Search.java +++ b/samples/src/main/java/org/opensearch/client/samples/Search.java @@ -23,7 +23,6 @@ import org.opensearch.client.opensearch._types.analysis.ShingleTokenFilter; import org.opensearch.client.opensearch._types.analysis.TokenFilter; import org.opensearch.client.opensearch._types.analysis.TokenFilterDefinition; -import org.opensearch.client.opensearch._types.mapping.IntegerNumberProperty; import org.opensearch.client.opensearch._types.mapping.Property; import org.opensearch.client.opensearch._types.mapping.TextProperty; import org.opensearch.client.opensearch._types.mapping.TypeMapping; @@ -62,15 +61,7 @@ public static void main(String[] args) { if (!client.indices().exists(r -> r.index(indexName)).value()) { LOGGER.info("Creating index {}", indexName); - IndexSettings settings = new IndexSettings.Builder().numberOfShards("2").numberOfReplicas("1").build(); - TypeMapping mapping = new TypeMapping.Builder().properties( - "age", - new Property.Builder().integer(new IntegerNumberProperty.Builder().build()).build() - ).build(); - CreateIndexRequest createIndexRequest = new CreateIndexRequest.Builder().index(indexName) - .settings(settings) - .mappings(mapping) - .build(); + CreateIndexRequest createIndexRequest = new CreateIndexRequest.Builder().index(indexName).build(); client.indices().create(createIndexRequest); }