{ $this->client =
$client;
$this->indexFactory =
$indexFactory;
$this->handlerRegistry =
$handlerRegistry;
} /**
* {@inheritdoc}
*/
public function search(Criteria
$criteria, ShopContextInterface
$context) { $search =
$this->
buildSearch($criteria,
$context);
$index =
$this->indexFactory->
createShopIndex($context->
getShop(), ProductMapping::TYPE
);
$arguments =
[ 'index' =>
$index->
getName(),
'body' =>
$search->
toArray(),
'rest_total_hits_as_int' => true,
'track_total_hits' => true,
];
$data =
$this->client->
search($arguments);