Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
dependencies {
implementation ‘org.opensearch.client:opensearch-rest-client: 2.7.0’
implementation ‘org.opensearch.client:opensearch-java:2.4.0’
}
Describe the issue:
List opsList = new ArrayList<>();
for (JSONObject event : events) {
BulkOperation op = new BulkOperation.Builder().create(o -> o
.index(indexName.toLowerCase())
.document(event)
).build();
opsList.add(op);
}
BulkRequest bulkRequest = new BulkRequest.Builder().operations(opsList).build();
BulkResponse bulkResponse = client.bulk(bulkRequest);
Here, I am trying to create new documents. Instead of using a customer class, I am using the json as the document input.
BulkOperation op = new BulkOperation.Builder().create(o → o.index(indexName.toLowerCase()).document(event)
The document will be created without any content.
Do I have to use a customer class here for opensearch?
For elastic search, it works fine.
Configuration:
Relevant Logs or Screenshots: