6. Sort¶
Sort people by age
1<?php
2
3$sort = $elastic->sort()
4 ->index('people')
5 ->field('age')
6 ->order('desc') // you can change to "asc"
7 ->search();
8
9return $sort;
Sort people by age
1<?php
2
3$sort = $elastic->sort()
4 ->index('people')
5 ->field('age')
6 ->order('desc') // you can change to "asc"
7 ->search();
8
9return $sort;