However this will run into an error in the search class
//if 1st arg is array means we have a sorting expression
if (is_array($field)) {
//if 2nd arg is true we full set the sort with the expr, otherwise just add it
//we let passing uppercased directions here as well
foreach ($field as $k => $v) {
$field[$k] = strtolower($v);
}
if (isset($direction) && $direction === true) {
$this->params['sort'] = $field;
} else {
$this->params['sort'] [] = $field;
}
return $this;
}
$v = the array of location_anchor or location_source
so strtolower throws an error here. Uncaught TypeError: strtolower(): Argument #1 ($string) must be of type string, array given
The docs show this example for geo sorting a search
However this will run into an error in the search class
$v = the array of location_anchor or location_source
so strtolower throws an error here.
Uncaught TypeError: strtolower(): Argument #1 ($string) must be of type string, array given