on ‎2018 Mar 02 9:21 AM
Is it possible to filter products during catalog-synchronization?
Use case: - master catalog with whole product set - country catalogues with subset of master products
Thanks in advance, Heiko
Request clarification before answering.
The way to go is described here https://wiki.hybris.com/pages/viewpage.action?spaceKey=hybrisALF&title=Catalog+Synchronization, why it doesn't work for you, can you provide the steps?
JobSearchRestriction is deprecated feature for a long time
According to our present recommendation, it is not a good approach any more to use the JobSearchRestrictions. In other words, it is not recommended to assign restrictions directly to the synchronization job. The best way to achieve your goal is to define a restriction for a dedicated user who will act as the synchronization job "runner". The sole purpose of this user existence is to restrict the scope of synchronized products by means of restrictions applied to him. Additional advantage of using restrictions concept is that they outcome can be seen as a result of Flexible Search query (respective tool available in administration console) so you can test them easily. Afterwards the forementioned user should be configured on the synchronization wizard -> advanced attributes tab -> session attributes section -> user field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The Jira link doesn't work for me.
Shouldn't the deprecation of JobSearchRestriction be mentioned here?
Thanks for your answer. I appreciate your frankness.
But a "normal" search restriction will not work! We have a masterCatalog as source and a lot of country-Catalogues as targets. This is a scenario you (Hybris) describe in your docu (https://help.hybris.com/6.6.0/hcd/8c6a38118669101481bdf1303d70949e.html)
That means: the result of the search-restriction depends on the target of the synchronization. That's why a user-dependant search restriction will not work, bute the JobSearchRestriction would be the perfect way.
I consider it as a bug and would request you to arrange a fix of it. Our proposal to the customer is based on your documentation and your advices.
If you say "After looking into the code it seems that JobSearchRestrictions are ignored by the sync job", than I ask: why? Is there a way to improve it?
Thanks in advance, Heiko.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No idea why you think I'm affiliated with Hybris. I was just trying to find a solution with you since this issue might be important for us one day...
Nevertheless I still think that "normal" search restrictions can help here. You have to have a sync job per target catalog anyways. So you can have one user per sync with different restrictions that will be applied.
Since my first answer was obviously not the way to go please try this approach: https://wiki.hybris.com/pages/viewpage.action?spaceKey=hybrisALF&title=Catalog+Synchronization
Basically it's the solution I was suggesting here.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes. I created an own item: OutboundChannel, with a relation to products. So I can compare againts it.
But where do I have to compare it? I did it within the JobSearchRestriction, but no success.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
You will need to have an attribute(i.e catalogRegion) at catalogVersion level to differentiate it for different countries. Then you can either customize the CatalogVersionSyncJob directly OR use interceptors by creating a product attribute and comparing its value with value in catalogRegion attribute.
Regards Rahul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, Tino
ut But unfortunately it does not work. To test it in easy way, I added a restriction with some fix primary keys of existing products in source catalog version:
INSERT_UPDATE CatalogVersionSyncJob;code[unique=true];$sourceProductCatVer;$targetProductCatVer; ;syncProductCatalog_Master->Online;;;;
INSERT_UPDATE JobSearchRestriction;code[unique=true];job(code);type(code);query ;Sync_OutboundChannelRestriction;syncProductCatalog_Master->Online;Product;{pk} in (8796093054977, 8796093120513)
But the sync job does not care about it :-( Any idea?
Heiko
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please see section "Using Restrictions with Jobs" here: https://help.hybris.com/6.6.0/hcd/8b9ce4868669101499b2f0f25ef9395f.html
TL;DR Create one or more JobSearchRestrictions and add them to your sync job.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.