Update nested document java api

i have below document structure:

{
        "_index" : "products",
        "_type" : "_doc",
        "_id" : "1f119af3-3b37-42bf-bd74-14266ad0487b",
        "_score" : 1.0,
        "_source" : {
          "id" : "1f119af3-3b37-42bf-bd74-14266ad0487b",
          "name" : "app1",
          "appVersions" : [
            {
              "versionId" : "94b324f5-b0d1-42f5-857c-05df83c47beb",
              "galleryImages" : [
                {
                  "profileImageName" : "apps/versions/gallery/SMALL_e3df848f-4706-48e7-99dc-0ff8a9eb2fee0",
                  "thumbnailImageName" : "apps/versions/gallery/LARGE_e3df848f-4706-48e7-99dc-0ff8a9eb2fee0"
                },
                {
                  "profileImageName" : "apps/versions/gallery/SMALL_e3df848f-4706-48e7-99dc-0ff8a9eb2fee1",
                  "thumbnailImageName" : "apps/versions/gallery/LARGE_e3df848f-4706-48e7-99dc-0ff8a9eb2fee1"
                }
              ]
            },
            {
              "versionId" : "9749070b-a384-4c67-bb72-9b6a8e008ca9",
              "galleryImages" : [
                {
                  "profileImageName" : "apps/versions/gallery/SMALL_e3df848f-4706-48e7-99dc-0ff8a9eb2fee0",
                  "thumbnailImageName" : "apps/versions/gallery/LARGE_e3df848f-4706-48e7-99dc-0ff8a9eb2fee0"
                },
                {
                  "profileImageName" : "apps/versions/gallery/SMALL_e3df848f-4706-48e7-99dc-0ff8a9eb2fee1",
                  "thumbnailImageName" : "apps/versions/gallery/LARGE_e3df848f-4706-48e7-99dc-0ff8a9eb2fee1"
                }
              ]
            }
          ]
        }
      }

here each app has an array of app-versions and each app-version has an array of gallery-images.

i want to update gallery images for matching versionId. can any one suggest how to achieve this using java apis.

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