Replace `IndexRequest.Builder.value()` call with call to `.document()` to reflect current state of API (#2658)
Please double-check that this is correct. I'm using `org.opensearch.client:opensearch-java:2.2.0` and `org.opensearch.client:opensearch-rest-client:2.5.0` to try to create a client as per the docs. I noticed that the call to `IndexRequest.Builder.value()` does not work. I believe the correct method name is ``IndexRequest.Builder.document()`
This commit is contained in:
parent
a1469d0cf5
commit
901bc63959
|
@ -172,7 +172,7 @@ You can index data into OpenSearch using the following code:
|
|||
|
||||
```java
|
||||
IndexData indexData = new IndexData("first_name", "Bruce");
|
||||
IndexRequest<IndexData> indexRequest = new IndexRequest.Builder<IndexData>().index(index).id("1").value(indexData).build();
|
||||
IndexRequest<IndexData> indexRequest = new IndexRequest.Builder<IndexData>().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<IndexData> indexRequest = new IndexRequest.Builder<IndexData>().index(index).id("1").value(indexData).build();
|
||||
IndexRequest<IndexData> indexRequest = new IndexRequest.Builder<IndexData>().index(index).id("1").document(indexData).build();
|
||||
client.index(indexRequest);
|
||||
|
||||
//Search for the document
|
||||
|
|
Loading…
Reference in New Issue