We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1、请求sql: select 终端类型,sum(订单数) 充电次数,sum(充电量) 充电电量,sum(运营时长) 运营时长 from xxx where 业务日期>='20250408+08:00' and 终端编号='1290833701' group by 终端类型 limit 10 2、上述中的DSL: { "from": 0, "size": 0, "query": { "bool": { "filter": [ { "bool": { "must": [ { "bool": { "must": [ { "range": { "业务日期": { "gte": "20250408+08:00", "boost": 1.0 } } }, { "match_phrase": { "终端编号": { "query": "1290833701" } } } ], "boost": 1.0 } } ], "boost": 1.0 } } ], "boost": 1.0 } }, "_source": { "includes": [ "终端类型", "sum", "sum", "sum" ], "excludes": [] }, "stored_fields": "终端类型", "aggregations": { "终端类型": { "terms": { "field": "终端类型", "size": 10, "shard_size": 5000, "min_doc_count": 1, "shard_min_doc_count": 0, "show_term_doc_count_error": false, "order": [ { "_count": "desc" }, { "_key": "asc" } ] }, "aggregations": { "充电次数": { "sum": { "field": "订单数" } }, "充电电量": { "sum": { "field": "充电量" } }, "运营时长": { "sum": { "field": "运营时长" } } } } } }
select 终端类型,sum(订单数) 充电次数,sum(充电量) 充电电量,sum(运营时长) 运营时长 from xxx where 业务日期>='20250408+08:00' and 终端编号='1290833701' group by 终端类型 limit 10
{ "from": 0, "size": 0, "query": { "bool": { "filter": [ { "bool": { "must": [ { "bool": { "must": [ { "range": { "业务日期": { "gte": "20250408+08:00", "boost": 1.0 } } }, { "match_phrase": { "终端编号": { "query": "1290833701" } } } ], "boost": 1.0 } } ], "boost": 1.0 } } ], "boost": 1.0 } }, "_source": { "includes": [ "终端类型", "sum", "sum", "sum" ], "excludes": [] }, "stored_fields": "终端类型", "aggregations": { "终端类型": { "terms": { "field": "终端类型", "size": 10, "shard_size": 5000, "min_doc_count": 1, "shard_min_doc_count": 0, "show_term_doc_count_error": false, "order": [ { "_count": "desc" }, { "_key": "asc" } ] }, "aggregations": { "充电次数": { "sum": { "field": "订单数" } }, "充电电量": { "sum": { "field": "充电量" } }, "运营时长": { "sum": { "field": "运营时长" } } } } } }
3、ES返回结果: { "took": 28, "timed_out": false, "_shards": { "total": 5, "successful": 5, "skipped": 0, "failed": 0 }, "hits": { "total": { "value": 3, "relation": "eq" }, "max_score": null, "hits": [] }, "aggregations": { "终端类型": { "doc_count_error_upper_bound": 0, "sum_other_doc_count": 0, "buckets": [ { "key": "AC single-phase", "doc_count": 2, "运营时长": { "value": 2880.0 }, "充电电量": { "value": 0.0 }, "充电次数": { "value": 0.0 } }, { "key": "AC three-phase", "doc_count": 1, "充电次数": { "value": 0.0 }, "充电电量": { "value": 0.0 }, "运营时长": { "value": 1440.0 } } ] } } }
{ "took": 28, "timed_out": false, "_shards": { "total": 5, "successful": 5, "skipped": 0, "failed": 0 }, "hits": { "total": { "value": 3, "relation": "eq" }, "max_score": null, "hits": [] }, "aggregations": { "终端类型": { "doc_count_error_upper_bound": 0, "sum_other_doc_count": 0, "buckets": [ { "key": "AC single-phase", "doc_count": 2, "运营时长": { "value": 2880.0 }, "充电电量": { "value": 0.0 }, "充电次数": { "value": 0.0 } }, { "key": "AC three-phase", "doc_count": 1, "充电次数": { "value": 0.0 }, "充电电量": { "value": 0.0 }, "运营时长": { "value": 1440.0 } } ] } } }
4、获取最终结果错位: [{"终端类型":"AC single-phase","运营时长":"2880.0","充电电量":"0.0","充电次数":"0.0"},{"终端类型":"AC three-phase","运营时长":"0.0","充电电量":"0.0","充电次数":"1440.0"}]
[{"终端类型":"AC single-phase","运营时长":"2880.0","充电电量":"0.0","充电次数":"0.0"},{"终端类型":"AC three-phase","运营时长":"0.0","充电电量":"0.0","充电次数":"1440.0"}]
5、代码追踪:
ObjectResultsExtractor 类: 
The text was updated successfully, but these errors were encountered:
目前更改办法: `
`
Sorry, something went wrong.
No branches or pull requests
1、请求sql:
select 终端类型,sum(订单数) 充电次数,sum(充电量) 充电电量,sum(运营时长) 运营时长 from xxx where 业务日期>='20250408+08:00' and 终端编号='1290833701' group by 终端类型 limit 10
2、上述中的DSL:
{ "from": 0, "size": 0, "query": { "bool": { "filter": [ { "bool": { "must": [ { "bool": { "must": [ { "range": { "业务日期": { "gte": "20250408+08:00", "boost": 1.0 } } }, { "match_phrase": { "终端编号": { "query": "1290833701" } } } ], "boost": 1.0 } } ], "boost": 1.0 } } ], "boost": 1.0 } }, "_source": { "includes": [ "终端类型", "sum", "sum", "sum" ], "excludes": [] }, "stored_fields": "终端类型", "aggregations": { "终端类型": { "terms": { "field": "终端类型", "size": 10, "shard_size": 5000, "min_doc_count": 1, "shard_min_doc_count": 0, "show_term_doc_count_error": false, "order": [ { "_count": "desc" }, { "_key": "asc" } ] }, "aggregations": { "充电次数": { "sum": { "field": "订单数" } }, "充电电量": { "sum": { "field": "充电量" } }, "运营时长": { "sum": { "field": "运营时长" } } } } } }
3、ES返回结果:
{ "took": 28, "timed_out": false, "_shards": { "total": 5, "successful": 5, "skipped": 0, "failed": 0 }, "hits": { "total": { "value": 3, "relation": "eq" }, "max_score": null, "hits": [] }, "aggregations": { "终端类型": { "doc_count_error_upper_bound": 0, "sum_other_doc_count": 0, "buckets": [ { "key": "AC single-phase", "doc_count": 2, "运营时长": { "value": 2880.0 }, "充电电量": { "value": 0.0 }, "充电次数": { "value": 0.0 } }, { "key": "AC three-phase", "doc_count": 1, "充电次数": { "value": 0.0 }, "充电电量": { "value": 0.0 }, "运营时长": { "value": 1440.0 } } ] } } }
4、获取最终结果错位:
[{"终端类型":"AC single-phase","运营时长":"2880.0","充电电量":"0.0","充电次数":"0.0"},{"终端类型":"AC three-phase","运营时长":"0.0","充电电量":"0.0","充电次数":"1440.0"}]
5、代码追踪:
ObjectResultsExtractor 类: 
The text was updated successfully, but these errors were encountered: