Skip to content

Conversation

@jgwatkincoveo
Copy link
Contributor

@jgwatkincoveo jgwatkincoveo commented Mar 20, 2024

LENS-1466

Added the capability of pushing the partialUpdate object in the UpdateStreamService. See Dictionary field update

Testing

Update the catalog using the SDK
This resulted in the following data
Screenshot 2024-03-20 at 10 58 00
Screenshot 2024-03-20 at 10 58 19
Screenshot 2024-03-20 at 10 58 33

After using the sdk with the following to update

UpdateStreamService updateStreamService = new UpdateStreamService(SourceBuilder.buildCatalogSource());
Map<String,String> dictionary = new HashMap<>();
dictionary.put("sp", "Spanish");
dictionary.put("de", "German");

PartialUpdateDocument partialUpdateDocument1 = new PartialUpdateDocument("http://someurl.com/92833", PartialUpdateOperator.FIELDVALUEREPLACE, "ec_description", "Some Great description");
PartialUpdateDocument partialUpdateDocument2 = new PartialUpdateDocument("http://someurl.com/92833", PartialUpdateOperator.ARRAYREMOVE, "availableskus", new String[]{"sku1"});
PartialUpdateDocument partialUpdateDocument3 = new PartialUpdateDocument("http://someurl.com/92833", PartialUpdateOperator.DICTIONARYPUT, "languages", dictionary);
PartialUpdateDocument partialUpdateDocument4 = new PartialUpdateDocument("http://someurl.com/92833", PartialUpdateOperator.DICTIONARYREMOVE, "languages", new String[]{"en", "fr"});

PartialUpdateDocument partialUpdateDocument5 = new PartialUpdateDocument("http://someurl.com/92834", PartialUpdateOperator.ARRAYAPPEND, "availableskus", new String[]{"sku1", "sku2"});
PartialUpdateDocument partialUpdateDocument6 = new PartialUpdateDocument("http://someurl.com/92834", PartialUpdateOperator.DICTIONARYREMOVE, "languages", "en");

updateStreamService.addPartialUpdate(partialUpdateDocument1);
updateStreamService.addPartialUpdate(partialUpdateDocument2);
updateStreamService.addPartialUpdate(partialUpdateDocument3);
updateStreamService.addPartialUpdate(partialUpdateDocument4);
updateStreamService.addPartialUpdate(partialUpdateDocument5);
updateStreamService.addPartialUpdate(partialUpdateDocument6);
HttpResponse<String> response = updateStreamService.close();

We get the following updated in the admin UI

Screenshot 2024-03-20 at 11 01 10
Screenshot 2024-03-20 at 11 01 25
Screenshot 2024-03-20 at 11 02 01

@jgwatkincoveo jgwatkincoveo requested review from a team, fbeaudoincoveo, olamothe, sallainCoveo, samisayegh and y-lakhdar and removed request for a team March 20, 2024 15:11
@jgwatkincoveo jgwatkincoveo changed the title LENS-1466 Added partial update support for update streaming service feat(LENS-1466): add support for partial updates in the UpdateStreamService Mar 20, 2024
Copy link

@samisayegh samisayegh left a comment

Choose a reason for hiding this comment

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

Great 🙌

Copy link

@sallainCoveo sallainCoveo left a comment

Choose a reason for hiding this comment

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

@jgwatkincoveo jgwatkincoveo merged commit 7725e54 into main Mar 26, 2024
@jgwatkincoveo jgwatkincoveo deleted the feature/LENS-1466-partial-update branch March 26, 2024 14:38
This was referenced Apr 30, 2024
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.

5 participants