Closed SergejGuruliov closed 5 months ago
Hey @SergejGuruliov , this is actually a bug.
You should be able to sort on multiple fields as per standard eloquent, ex:
Product::orderBy('status')->orderByDesc('price')->get();
However, only the first order clause is being processed.
This will be fixed in the new 3.x major release - ca. 1 week from now. Will close this issue to notify you then.
Thanks for flagging this.
@SergejGuruliov - this bug has been fixed in the new 3.x version
Sorting on Multiple Fields orderBy set only one field
pdphilip/elasticsearch/src/DSL/QueryBuilder.php:380 $field = array_shift($value);