【发布时间】:2020-10-20 19:43:00
【问题描述】:
在 Elastic 中,我正在尝试对 bool 查询过滤器进行平均聚合。但我得到 unable to parse BaseAggregationBuilder with name [query]: parser not found。
我的目标:
- 过滤 processName:AddCustomer 和 messageType:Response 文件。
- 使用字段 elapsed_time 查找过滤数据的平均响应时间
我的代码
{
"from": 0,
"size": 20,
"aggs": {
"filtered_elapsed_time": {
"query": {
"bool": {
"should": [
{
"bool": {
"must": [
{
"match": {
"processName": "AddCustomer"
}
},
{
"match": {
"messageType": "Response"
}
}
]
}
}
]
}
},
"aggs": {
"avg_et": {
"avg": {
"field": "elapsed_time"
}
}
}
}
}
}
错误响应
{
"error": {
"root_cause": [
{
"type": "named_object_not_found_exception",
"reason": "[6:18] unable to parse BaseAggregationBuilder with name [query]: parser not found"
}
],
"type": "named_object_not_found_exception",
"reason": "[6:18] unable to parse BaseAggregationBuilder with name [query]: parser not found"
},
"status": 400
}
【问题讨论】:
标签: elasticsearch