Fallback to own Magento search in case of search API error
Closed this issue · 5 comments
Seems that any API error is caught here:
doofinder-magento/app/code/community/Doofinder/Feed/Helper/Search.php
Lines 66 to 74 in d428a75
And an empty array of results is set. The method is called from here:
Instead of getting empty results would be better to log the error and fallback to the default search results.
@carlosescri This change seems to not to be difficult but we don't remember much from the module code on M1. We'll need about 4h to analyse it, do it and test it. Should we take care of it?
Ok, @magently.
@carlosescri We overestimated it and it took less time than expected :)
Here are the changes: https://github.com/magently/doofinder-magento/tree/feature/fallback
@magently I've seen the code, but… what would happen if there are no search results but no error?
Remember that the thing is to catch Doofinder service errors (502, bad requests…), log them somewhere if possible, and fallback to Magento's default search, but only in case of errors. The module should not fall back to Magento's default search in case Doofinder says that no results match the search terms.
@carlosescri sorry, it's our bad. We've corrected it on the same branch.
log them somewhere if possible,
Logging has already been done.