Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mappings and settings with json #985

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JM-Lab
Copy link

@JM-Lab JM-Lab commented May 14, 2024

Description

This PR adds functionality to use JSON for mappings and settings in CreateIndexRequest.
This makes it easier for developers to create indices.

Issues Resolved

Fixes #302

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Jemin Huh <hjm1980@gmail.com>
}

private <T> T deserialize(JsonpDeserializer<T> deserializer, String json) {
JsonpMapper jsonpMapper = new JacksonJsonpMapper();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not going to work, the JsonpMapper is provided by the user when OpenSearchClient instance is created, it has to be respected.

@reta
Copy link
Collaborator

reta commented May 14, 2024

Please refer to #257 , the client would benefit from generalized approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Creating API objects from JSON data
2 participants