ElasticsearchDSL
ElasticsearchDSL copied to clipboard
Unable to add multiple field sorts
Adding multiple field sorts overwrites previous additions.
$search = new Search();
// Add some queries...
$sort1 = new FieldSort('acme1', null, ['order' => FieldSort::ASC]);
$sort2 = new FieldSort('acme2', null, ['order' => FieldSort::DESC]);
$search->addSort($sort1);
$search->addSort($sort2);
$body = $search->toArray() // Only $sort2 is present in the output
It's possible this is only occurring on Windows and seems to be related to the usage of uniqid as seen in some other issues.
Pull request #236