elasticsuite icon indicating copy to clipboard operation
elasticsuite copied to clipboard

The ability to apply optimizer to every category except some.

Open Hexmage opened this issue 3 years ago • 3 comments

Is your feature request related to a problem? Please describe. Currently it's only possible to apply optimizer to all all categories or some selected categories. I currently have a client who has over 1000 categories and wants to apply a booster to all categories except a couple of specific ones. Currently you'd have to select 999+ categories by hand to exclude it from one.

Describe the solution you'd like Screenshot from 2022-10-27 15-39-28 A All but Selected Categories in this dropdown.

Additional context The currently implementation doesn't easily allow for this logic to be implemented.

Hexmage avatar Oct 27 '22 13:10 Hexmage

Hello @Hexmage

We will try to take this into account in our future releases.

BR, Vadym

vahonc avatar Nov 03 '22 15:11 vahonc

@romainruaud I see that this was given a priority tag. Is there any indication of a timeline?

Hexmage avatar Feb 22 '23 14:02 Hexmage

@vahonc can you work on this ?

  1. Add a "All but Selected Categories" in this dropdown, selecting it should display the Category dropdown. The value associated to this option should be "2" and choosing it should display the Category selector : https://github.com/Smile-SA/elasticsuite/blob/2.11.x/src/module-elasticsuite-catalog-optimizer/view/adminhtml/ui_component/smile_elasticsuite_catalog_optimizer_form.xml#L560

  2. Save the data in the appropriate table. The data should contain :

  • "apply_to = 2" for the searchContainer part (this should work automatically here : https://github.com/Smile-SA/elasticsuite/blob/2.11.x/src/module-elasticsuite-catalog-optimizer/Model/ResourceModel/Optimizer.php#L166 )
  • and the category_ids should be saved as well without needing to change https://github.com/Smile-SA/elasticsuite/blob/2.11.x/src/module-elasticsuite-catalog-optimizer/Model/ResourceModel/Optimizer/Limitation.php#L85.
  1. Ensure the boosts are properly applied in Front-Office on all categories except the selected. You should probably add something like "OR (osc.apply_to = 2 AND main_table.{$column} != ?)" to this line : https://github.com/Smile-SA/elasticsuite/blob/2.11.x/src/module-elasticsuite-catalog-optimizer/Model/ResourceModel/Optimizer/Limitation.php#L137

  2. Investigate if the legacy caching mechanism is OK with this new "all categories but selected" mechanism : https://github.com/Smile-SA/elasticsuite/blob/2.11.x/src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Limitation/Identities.php#L143

romainruaud avatar Aug 02 '24 12:08 romainruaud