-
Notifications
You must be signed in to change notification settings - Fork 341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In optimizers preview in admin panel optimizers are not filtered properly #1846
Comments
P.S.
|
Hello @androshchuk, Could you confirm the issue and validate/integrate the proposed fix ? |
Hello @sevka Regards |
@androshchuk |
@androshchuk
|
Hello @sevka Regards |
When editing - for me it works fine. Actually this the difference: existing optimizer already has ID and it is in the array. Try to test this case please: open some existing optimizer and change something in the optimizer configuration but do not save it. Then run a preview. Once I've got some weird result but then I was not able to reproduce it again. I see there is a some cache also, maybe this is the reason. |
Fix #1846 optimizer preview with search context
During new optimizer creation (or editing) in admin panel, if I click the "Preview" button, the wrong search result appears in both "Base Results" and "Optimized Results" columns. The product list differs from the products list on the search result page on the Frontend.
I debugged it and found this:
\Smile\ElasticsuiteCatalogOptimizer\Model\Optimizer\Search\OptimizerFilter::getOptimizerIds()
\Smile\ElasticsuiteCatalogOptimizer\Model\Optimizer\Category\OptimizerFilter::getOptimizerIds()
There are conditions like this:
if ($this->searchContext->getCurrentSearchQuery()) {
and
if ($this->searchContext->getCurrentCategory()) {
They never return true, so getOptimizerIds() always return null. Then here
\Smile\ElasticsuiteCatalogOptimizer\Model\Optimizer\ApplierList::applyOptimizers
at this line optimizers are never filtered:
$functions = array_intersect_key($functions, array_flip($optimizerIds));
Elasticsuite doesn't respect the query text and selected category during the Preview from admin panel. When I search from the Frontend, everything is fine.
For me, it looks like a bug. Could you advise, please? Maybe it's a feature I do not get ;)
Preconditions
Magento Version : 2.3.3.
ElasticSuite Version :
I faced the issue on 2.8.4, but I've reproduced it on latest 2.8.7 as well.
Environment :
Dev and Prod.
Third party modules :
Amasty_Base
Amasty_Feed
Amasty_ProductAttachment
FireGento_FastSimpleImport
CtiDigital_Configurator
MSP_ReCaptcha
MSP_TwoFactorAuth
Magehelper_Menusearch
SchumacherFM_Mocks
Smile_DebugToolbar
Smile_ElasticsuiteAdminNotification
Smile_ElasticsuiteCore
Smile_ElasticsuiteCatalog
Smile_ElasticsuiteCatalogRule
Smile_ElasticsuiteCatalogOptimizer
Smile_ElasticsuiteAnalytics
Smile_ElasticsuiteQuickOrder
Smile_ElasticsuiteSwatches
Smile_ElasticsuiteThesaurus
Smile_ElasticsuiteVirtualCategory
Tigren_Ajaxsuite
Tigren_Ajaxcompare
Steps to reproduce
Expected result
Actual result
P.S. The same with a category. If you have some optimizer A with selected categories and then in another optimizer B search for some another category in Preview, optimizer A is applied anyway.
The text was updated successfully, but these errors were encountered: