fix sorting by metadatas on using elasticsearch
This commit is contained in:
parent
2450539c4a
commit
5b330c88be
|
@ -265,6 +265,15 @@ class Elastic_Press {
|
|||
$formatted_args = $this->prepare_request_for_facet($formatted_args);
|
||||
break;
|
||||
}
|
||||
if( isset($formatted_args['sort']) ) {
|
||||
$new_sort = [];
|
||||
foreach ($formatted_args['sort'] as $sort) {
|
||||
foreach ($sort as $key => $value) {
|
||||
$new_sort["$key.raw"] = $value;
|
||||
}
|
||||
}
|
||||
$formatted_args['sort'] = $new_sort;
|
||||
}
|
||||
return $formatted_args;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue