这里需要用到script脚本,示例如下:
$params['body']['sort'] = [ "_script" => [ "script" => [ "inline" => "doc['zwk_zkrs'].value > 0 ? doc['zwk_hege'].value/doc['zwk_zkrs'].value : 0" ], "type" => "number", "order" => "desc" ] ];
[ "script" => [ "inline" => "doc['zwk_zkrs'].value > 0 ? doc['zwk_hege'].value/doc['zwk_zkrs'].val">
523阅读 0条评论
这里需要用到script脚本,示例如下:
$params['body']['sort'] = [ "_script" => [ "script" => [ "inline" => "doc['zwk_zkrs'].value > 0 ? doc['zwk_hege'].value/doc['zwk_zkrs'].value : 0" ], "type" => "number", "order" => "desc" ] ];