I'm using elasticsearch-php & upgraded ealsticsearch from 2.3.2 to 5.0.0, and there is something wrong with DSL sort field.
PHP code :
$dsl = [ 'from' => G('elasticsearch')['page_size'] * ($_GET['page'] - 1), 'size' => G('elasticsearch')['page_size'], 'index' => 'logs-xxxx', 'timeout' => '55s', 'sort' => [ ['_score' => 'desc'] ], ........ ];
I got an exception :
illegal_argument_exception: request [/logs-xxxx/_search] contains unrecognized parameter: [sort[_score]]
According to this document, sort parameter should firstly be an array then cotains dicts which described sort fields & orders.
So is there anything wrong with my php code ?