咨询下各位大佬 ES 聚合排序的问题

2021-03-09 16:58:20 +08:00
 unbright

es 是不是不能能 AggregationBuilders.terms 的字段进行排序,用了后报这个错。 Buckets can only be sorted on a sub-aggregator path that is built out of zero or more single-bucket aggregations within the path and a final single-bucket or a metrics aggregation at the path end

1316 次点击
所在节点    Java
5 条回复
456789
2021-03-10 10:36:24 +08:00
插眼问下 有没有好的使用 es 的例子,主要是对 RestHighLevelClient 的关闭管理这里想看看有没有好的
sonice
2021-03-10 14:20:10 +08:00
@456789 #1 client 官方是推荐单例的,不要重复去开关。可以自己控制 io thread 数量来控制并发。
sinux
2021-03-10 14:22:58 +08:00
没 query 不太懂想怎么排序。建议看看 bucket sort aggregation 那部分 。
unbright
2021-03-10 14:31:11 +08:00
@sinux 用的 bucket_sort,补充了 dsl,大佬看下哪里有问题
sinux
2021-03-11 11:26:10 +08:00
@unbright #4 请问解决了吗?想知道究竟是哪里的问题.....

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/760048

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX