疲劳是最舒适的枕头,努力工作吧。

ES SQL进行聚合topN的时候值不对

Elasticsearch | 作者 gxHu | 发布于2020年07月27日 | 阅读数:1754

ES版本7.1.1,本人想查src的top5,但是返回的值明显不对
curl -XPOST "192.168.0.108:9200/_sql?format=txt&pretty" -H 'Content-type: application/json' -d'
{
"query": "select src,count(1) c from bigeyedata group by src having c < 10000 order by c desc limit 5"
}'
curl -XPOST "192.168.0.108:9200/_sql?format=txt&pretty" -H 'Content-type: application/json' -d'
{
"query": "select src,count(1) c from bigeyedata group by src having c < 10000 and c > 10 order by c desc limit 5"
}'

test.png

 这两条对比就能发现明显不对。

 
已邀请:

xizechuan - 沉迷学习,无法自拔

赞同来自:

好问题,我也想知道

libeep

赞同来自:

插眼

tacsklet - 公司有用到es

赞同来自:

你试试最新版的行不行,不行就去提issue吧

viewsite

赞同来自:

贴一下 _sql/translate结果 看看

gxHu - 90

赞同来自:

1.png

gxHu - 90

赞同来自:


应该是这吧

要回复问题请先登录注册