有个人长的像洋葱,走着走着就哭了…….

有from size的时候 sort无效,大哥看到的就过来帮看一眼吧

Elasticsearch | 作者 yangshubao911 | 发布于2018年11月09日 | 阅读数:3740


GET _search
{
"from": 1,
"size": 20,
"query": {
"bool": {
"must": [{
"term": {
"cityCode": {
"value": "001009001",
"boost": 1.0
}
}
}, {
"bool": {
"should": [{
"term": {
"scopeId": {
"value": "232",
"boost": 1.0
}
}
}],
"adjust_pure_negative": true,
"boost": 1.0
}
}],
"adjust_pure_negative": true,
"boost": 1.0
}
},
"sort": [{
"isPlateTop": {
"order": "desc"
}
}]
}
没有from size的时候排序是好的,带上就没有排序效果了 是什么原因呢,怎么解决啊
已邀请:

rochy - rochy_he

赞同来自:

排序与 from/size 是没有任何关系的
你可以截图结果看一下么?

God_lockin

赞同来自:

get 请求es不会处理你的dsl的,全都当作⬇️处理
{
"query":{}
}

laoyang360 - 《一本书讲透Elasticsearch》作者,Elastic认证工程师 [死磕Elasitcsearch]知识星球地址:http://t.cn/RmwM3N9;微信公众号:铭毅天下; 博客:https://elastic.blog.csdn.net

赞同来自:

get改成post。

zqc0512 - andy zhou

赞同来自:

带参数的 POST 

GET _search
修改成

XPOST _search
 

要回复问题请先登录注册