-
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
Empty category issue #3391
Comments
Hi @Nuranto I think that, as a first step, we'll add something onto this line : https://github.com/Smile-SA/elasticsuite/blob/2.11.x/src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Adapter.php#L84 Most probably, we'll add to the HTTP context some variable, like "X-Search-Failure". This should allow you to set these pages as not-cacheable with a plugin on the HTTP context later on. Would this fit ? Regards |
Hi @romainruaud , Thank you for your answer, We already fixed the caching issue by throwing the exception when it happens. We prefer a temporary error on our category page than a long-term empty category. Your solution would work too, but I think a more "out of the box" solution would be better. And it works, we just got alerted that the issue occured again. Here is the exception that causes the issue :
After cleaning magento cache ( I don't know where to search here, any ideas on how to debug ? How a query can be empty, and why purging cache solves that ? |
Magento Version : 2.4.7-p2
ElasticSuite Version : 2.11.8.3
Steps to reproduce
src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Adapter.php
: add line$searchResponse = [];
beforereturn
Expected result
Actual result
Additional informations
The case where an exception is thrown and
$searchResponse
gets empty is very very rare in our case. But when it happens, it may be put in cache by Varnish, which causes empty categories displayed to customers for hours...Also the exception logging method (
$this->logger->error($e->getMessage());
) is not very handy. A specific logfile and usage of$this->logger->critical($e);
would be more powerfull for debugging.Note : jfyi there's a similar issue on Adobe's adapter : magento/magento2#38284
The text was updated successfully, but these errors were encountered: