ElasticSearch - Ordering aggregation by nested aggregation on nested field

前端 未结 1 714
我在风中等你
我在风中等你 2021-01-19 13:22
{
  "query": {
    "match_all": {}
  },
  "from": 0,
  "size": 0,
  "aggs": {
    "itineraryId": {
               


        
相关标签:
1条回答
  • 2021-01-19 13:55

    As Val has pointed out in the comments ES does not support it yet.

    Till then you can first aggregate the nested aggregation and then use the reverse nested aggregation to aggregate the duration, that is present in the root of the document.

    https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-reverse-nested-aggregation.html

    0 讨论(0)
提交回复
热议问题