So when you update magento 2 then you might face this problem when you enter the Elasticsearch details. When you click on test connection it will pop an error stating class not found. To fix this you need to simply run this command
php bin/magento config:set catalog/search/engine elasticsearch7
You will see your issue is resolved.
2X Certified Adobe Magento Commerce with 10+ years’ experience in Magento platform