Skip to content

Commit

Permalink
reverting files to original state
Browse files Browse the repository at this point in the history
Signed-off-by: Karthik Subramanian <[email protected]>
  • Loading branch information
karthiks3000 committed Oct 27, 2023
1 parent 448ef4d commit dad8008
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
11 changes: 1 addition & 10 deletions samples/src/main/java/org/opensearch/client/samples/Search.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit dad8008

Please sign in to comment.