Isuue while overriding JSON object in document

Hello,

I want to perform a task which requires below activities:

  1. Override "xyz" record with the new "xyz" record completely (avoid update/merging) in the existing document.
  2. New "xyz" record structure could be different. Therefore I am preferring to override it with its key name.

I used "new IndexRequest(indexName).id(docId).source(sourceMap, XContentType.JSON)", with below combination:

  • When tried to pass "xyz" as JSONObject got error "cannot write xcontent for unknown value of type class org.json.JSONObject"

  • When tried to pass "xyz" as JsonString got error "tried to parse field [xyz] as object, but found a concrete value"

  • When tried to pass "xyz" as JsonBytes got error "tried to parse field [xyz] as object, but found a concrete value"

  • When tried to pass "xyz" as DTO got error "tried to parse field [xyz] as object, but found a concrete value"

Could someone please assist me in this?

Thanks,
Pradeep Pawar

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.