0

How can i add a new field value in existing Array of algolia indices. I have created a new indices for ex in below imagemy indices

with this method from this link https://stackoverflow.com/a/49607796/4232013

     user_details.put("user_username", username);
                            user_details.put("user_email_id", email);
                            user_details.put("user_id", UUID);
     Client client = new Client(ApplicationId, AlgoliaKey);
                                    Index index = client.getIndex("Users");

                                    List<JSONObject> array = new ArrayList<JSONObject>();

                                    array.add(new JSONObject(user_details));


                                    index.addObjectsAsync(new JSONArray(array), null);

But later if i want to add a image url how can i update this field in existing indices i checked the official documentation https://www.algolia.com/doc/api-reference/api-methods/partial-update-objects/#examples but its not clear for me can anyone help me out.Thanks

AndroidRocket
  • 418
  • 3
  • 14

1 Answers1

1

As per the Official Documentation you can partialUpdateObject

  index.partialUpdateObjectAsync(
    new JSONObject("{\"state\": \"California\"}"),
   "myID",//here provide the object Id 
  null
 );
Shiva s
  • 710
  • 1
  • 6
  • 13