public function search(string
$entityName, array
$criteria): EntitySearchResult
{ $criteriaObject =
$this->
prepareCriteria($entityName,
$criteria);
return $this->registry->
getSalesChannelRepository($entityName)->
search($criteriaObject,
$this->context
);
} /**
* The `ids()` method allows you to search for the Ids of Entities that match a given criteria.
*
* @param string $entityName The name of the Entity you want to search for, e.g. `product` or `media`.
* @param array<string, mixed> $criteria The criteria used for your search.
*
* @return IdSearchResult A `IdSearchResult` including all entity-ids that matched your criteria.
*
* @example store-search-ids/script.twig Get the Ids of products with the given ProductNumber.
*/