Elasticsearch直方图聚合中的订单失败

时间:2018-10-11 06:04:59

标签: elasticsearch elasticsearch-aggregation

我们已经将ElasticSearch从5.5升级到6.4,我们有了直方图聚合,我们希望以定义的顺序提供新版本,以提供对此错误的错误并在下面进行查询

"aggs": {
    "group_by_property": {
        "histogram": {
            "field": "midoffice_master_id",
            "order": {
                "room_types_group>check_availability>min_avg_price.value": "asc"
            },                
            "interval": 1,
            "min_doc_count": 1
        },
        "aggs": {
            "room_types_group": {
                "nested": {
                    "path": "prices_and_availability"
                },
                "aggs": {
                    "check_availability": {
                        "filter": {
                            "bool": {
                                "must": [
                                    {
                                        "terms": {
                                            "prices_and_availability.stock_date": [
                                                "2018-10-10",
                                                "2018-10-11"
                                            ]
                                        }
                                    },
                                    {
                                        "range": {
                                            "prices_and_availability.open_rooms": {
                                                "gte": 1
                                            }
                                        }
                                    },
                                    {
                                        "range": {
                                            "prices_and_availability.default_price": {
                                                "gt": 0
                                            }
                                        }
                                    },
                                    {
                                        "terms": {
                                            "prices_and_availability.room_type_id": [
                                                2,3,4,5,6,7,8,9
                                            ]
                                        }
                                    }
                                ]
                            }
                        },
                        "aggs": {
                            "room_types": {
                                "terms": {
                                    "field": "prices_and_availability.room_type_id",
                                    "min_doc_count": 2,
                                    "order": {
                                        "avg_price": "desc"
                                    }
                                },
                                "aggs": {
                                    "avg_price": {
                                        "sum": {
                                            "field": "prices_and_availability.default_price"
                                        }
                                    }
                                }
                            },
                            "min_avg_price": {
                                "min_bucket": {
                                    "buckets_path": "room_types>avg_price"
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}

它在5.5中工作正常,但在6.4中给出了错误 删除订单后,它的工作原理,但我需要它与键排序 room_types_group.check_availability.min_avg_price.value 我如何在6.4中做到这一点 检查这没有帮助 https://www.elastic.co/guide/en/elasticsearch/reference/6.x/search-aggregations-bucket-terms-aggregation.html#search-aggregations-bucket-terms-aggregation-order

  

Elasticsearch :: Transport :: Transport :: Errors :: InternalServerError:[500] {“错误”:{“ root_cause”:[{“类型”:“ aggregation_execution_exception”,“原因”:“无效的聚合器订单路径[ room_types_group> check_availability> min_avg_price.value]。未知聚合[min_avg_price]“}],” type“:” search_phase_execution_exception“,” reason“:”所有分片均失败“,” phase“:” query“,” grouped“:true, “ failed_shards”:[{“ shard”:0,“ index”:“ sale_property_production_j”,“ node”:“ 48YRwwq5TdCbvjRVLBH_rw”,“ reason”:{“ type”:“ aggregation_execution_exception”,“ reason”:“无效的聚合顺序[room_types_group> check_availability> min_avg_price.value]。未知汇总[min_avg_price]“}}]},”状态“:500}>

0 个答案:

没有答案