I have a Query to matchAll product in ElasticSearch. It run perfeclty but I want to add a Sort for this Query. I don't find example which run and I don't understand why it generate error.
This code for sorting query :
$match = new \Elastica\Query\MatchAll();
$query = new \Elastica\Query($match);
$query->addSort([
'product.price' => ['order' => 'asc']
]);
return $this->find($query);
Generate this error :
Error: Wrong parameters for Exception([string $exception [, long $code [, Exception $previous = NULL]]])
I try lot of thing before post this but the error is always the same.
ElasticSearch : 5.2.2
FosElasticaBundle : 3.2.2
PHP : 5.6.30
Symfony : 2.8