diff --git a/_clients/java.md b/_clients/java.md index a8d993c4..b5197528 100644 --- a/_clients/java.md +++ b/_clients/java.md @@ -172,7 +172,7 @@ You can index data into OpenSearch using the following code: ```java IndexData indexData = new IndexData("first_name", "Bruce"); -IndexRequest indexRequest = new IndexRequest.Builder().index(index).id("1").value(indexData).build(); +IndexRequest indexRequest = new IndexRequest.Builder().index(index).id("1").document(indexData).build(); client.index(indexRequest); ``` {% include copy.html %} @@ -283,7 +283,7 @@ public class OpenSearchClientExample { //Index some data IndexData indexData = new IndexData("first_name", "Bruce"); - IndexRequest indexRequest = new IndexRequest.Builder().index(index).id("1").value(indexData).build(); + IndexRequest indexRequest = new IndexRequest.Builder().index(index).id("1").document(indexData).build(); client.index(indexRequest); //Search for the document @@ -313,4 +313,4 @@ public class OpenSearchClientExample { } } ``` -{% include copy.html %} \ No newline at end of file +{% include copy.html %}