I'm encountering an issue where products are not displaying in category pages on my Magento 2.4.7-p2 site. However, I can access the products through their direct URLs without any issues.
I changed the Theme to check, Luma, Blank infinit-by Codazon.
php bin/magento indexer:reset,
php bin/magento indexer:reindex, but the issue persists.
In exception.log I foun, but i checked Elasticsearch8 is working,
#1 html/vendor/elasticsearch/elasticsearch/src/Client.php(172): Elastic\Elasticsearch\Response\Elasticsearch->setResponse() #2 html/vendor/elasticsearch/elasticsearch/src/Traits/ClientEndpointsTrait.php(1567): Elastic\Elasticsearch\Client->sendRequest() #3 html/vendor/magento/module-elasticsearch-8/Model/Client/Elasticsearch.php(371): Elastic\Elasticsearch\Client->search() #4 /html/vendor/magento/module-elasticsearch-8/SearchAdapter/Adapter.php(109): Magento\Elasticsearch8\Model\Client\Elasticsearch->query()
Has anyone else experienced this problem, or can suggest what might be causing this issue? Any insights or guidance would be greatly appreciated!
Add this in you env.php and configure accordingly
'search' => [
'engine' => 'elasticsearch8',
'elasticsearch8_server_hostname' => 'localhost', // or your Elasticsearch server hostname
'elasticsearch8_server_port' => '9200', // default Elasticsearch port
'elasticsearch8_index_prefix' => '', // optional prefix for the index
'elasticsearch8_enable_auth' => false, // enable if authentication is required
'elasticsearch8_server_timeout' => 15, // timeout in seconds
'elasticsearch8_username' => '', // Elasticsearch username, if authentication is enabled
'elasticsearch8_password' => '' // Elasticsearch password, if authentication is enabled
],