Yesterday I told you, that you can select the entities which are searched by default on the Shopware administration dashboard. That was a chance find, while debugging while the search doesn’t work at all.
If you are running elastic/open search all entities which are searchable need an Indexer, a few hints how to do it, because I can’t find any documentation for it:
Not very helpful, because the „real“ error is eaten somewhere.
Looking into the log (var/log/prod-<date>.log)
[2023-12-15T11:53:47.554940+00:00] request.CRITICAL: Uncaught PHP Exception Shopware\Elasticsearch\Exception\ElasticsearchIndexingException: "Following errors occurred while indexing: " at /var/www/vendor/shopware/elasticsearch/Admin/AdminSearchRegistry.php line 17 {"exception":"[object] (Shopware\\Elasticsearch\\Exception\\ElasticsearchIndexingException(code: 0): Following errors occurred while indexing: \n at /var/www/vendor/shopware/elasticsearch/Admin/AdminSearchRegistry.php:175)"} []
Okay, a file and a line
public function getIndexer(string $name): AbstractAdminIndexer
{
$indexer = $this->indexer[$name] ?? null;
if ($indexer) {
return $indexer;
}
// line 175 - how unexpected.
throw new ElasticsearchIndexingException([\sprintf('Indexer for name %s not found', $name)]);
}
So in theory we should get this error and the indexer name, but it gets lost somewhere. So the old way
var_dump() and die() debugging
Although we know how xdebug works, there are times were „the good ol‘ way“ brings as faster results. And especially if I’m running on the shopware backend, I „only“ disturb our customer, not the customer’s customer. So I added a var_dump($name); die(); and got an indexer name out.