Inspired by the we-are-virtua/magento2-search-fix repo and @vadim-shulyak's comment
Apply patch using composer-patches: https://www.classyllama.com/blog/create-apply-patches-magento-2#applying_patches
I prefer to apply changes like this as a patch, as if the underlying code ever changes, the patch will fail to apply and you can remedy the issue.