Update index using json

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
opesearch-rest-high-level-client:2.4.0

Describe the issue:
Is there a way to update part of an existing index with json?
For eg:
Current index
{
“_index”: “record_index”,
“_type”: “_doc”,
“_id”: “123456”,
“_version”: 1,
“_score”: 0,
“_source”: {
“record”: “{\n “uuid”: “123456”,\n “status”: “S”,\n “comments”: “Test record only”}”
}
}

update it to
{
“_index”: “record_index”,
“_type”: “_doc”,
“_id”: “123456”,
“_version”: 1,
“_score”: 0,
“_source”: {
“record”: “XYZ”
}
}

where XYZ is a json

something like this
XContentBuilder jb = XContentFactory.jsonBuilder();
jb.startObject().field(“record”, XYZ).endObject();

Configuration:

Relevant Logs or Screenshots:

I want to point people here to see a discussion on this question: