$arguments =
[ 'index' =>
$index->
getName(),
'body' =>
$search->
toArray(),
'rest_total_hits_as_int' => true,
'track_total_hits' => true,
];
$data =
$this->client->
search($arguments);
$products =
$this->
createProducts($data);
$result =
new ProductNumberSearchResult( $products,
$data['hits'
]['total'
],
[] );
if (isset($data['hits'
]['max_score'
])) { $result->
addAttribute('elastic_search',
new Attribute(['max_score' =>
$data['hits'
]['max_score'
]]));
} foreach ($this->handlerRegistry->
getHandlers() as $handler) { if (!
($handler instanceof ResultHydratorInterface
)) {