如同磁铁吸引四周的铁粉,热情也能吸引周围的人,改变周围的情况。

es排序asc时,怎么把空值放在前面

Elasticsearch | 作者 liuliuliu | 发布于2018年11月12日 | 阅读数:6406

对某个字段进行sort排序时,不管升序还是降序,空值都是排在最后面,可不可以asc的时候排在最前面,desc的时候排在最后面
已邀请:

rochy - rochy_he

赞同来自: liuliuliu

GET /_search
{
"sort" : [
{ "price" : {"missing" : "_last"} }
],
"query" : {
"term" : { "product" : "chocolate" }
}
}
 
具体可参考:https://www.elastic.co/guide/e ... .html

要回复问题请先登录注册