opensearch-java icon indicating copy to clipboard operation
opensearch-java copied to clipboard

[FEATURE] support dynamic schema for creating/updating document

Open zhzhou-tibco opened this issue 1 year ago • 2 comments

Is your feature request related to a problem?

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. The document will be created without any content.

What solution would you like?

I would like to create document API to accept the Json type input

What alternatives have you considered?

A clear and concise description of any alternative solutions or features you've considered.

Do you have any additional context?

Add any other context or screenshots about the feature request here.

zhzhou-tibco avatar Jun 13 '23 19:06 zhzhou-tibco

Take a look through some of the open issues. There are a few proposals to solve this issue and some people working on it. Maybe you could comment on those and see if they are aimed in the right direction to help you?

wbeckler avatar Jun 19 '23 12:06 wbeckler

Here's an example: https://github.com/opensearch-project/opensearch-java/issues/377

wbeckler avatar Aug 02 '23 16:08 wbeckler