zincsearch icon indicating copy to clipboard operation
zincsearch copied to clipboard

Aggregation bug

Open chenny opened this issue 1 year ago • 0 comments

=============dada source:=================== curl http://localhost:4080/api/_bulk -i -u admin:Complexpass#123 --data-binary "@olympics.ndjson" HTTP/1.1 100 Continue

HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 Zinc: v0.4.7-1-g4c2442f Date: Fri, 30 Jun 2023 07:01:03 GMT Content-Length: 53

{"message":"bulk data inserted","record_count":36935}

swagger api debug: { "search_type": "match", "query": { "term": "Ice Hockey" }, "sort_fields": ["-@timestamp"], "from": 0, "max_results": 20, "aggs": { "Medal": { "agg_type": "term", "field": "Medal", "size": 10 }, "Year": { "agg_type": "range", "field": "Year", "size": 10, "ranges": [ {"from": 1900, "to": 1920}, {"from": 1921, "to": 1950}, {"from": 1951, "to": 2000}, {"from": 2000, "to": 2021} ] }, "@timestamp": { "agg_type": "date_range", "field": "@timestamp", "size": 10, "date_ranges": [ { "from": "2020-01-21T09:22:50.604Z", "to": "2021-01-21T09:22:50.604Z" }, { "from": "2021-01-22T09:22:50.604Z", "to": "2023-01-21T09:22:50.604Z" } ] }, "max_Year": { "agg_type": "max", "field": "Year" }, "min_Year": { "agg_type": "min", "field": "Year" }, "avg_Year": { "agg_type": "avg", "field": "Year" }, "weighted_avg_Year": { "agg_type": "weighted_avg", "field": "Year", "weight_field": "Year" }, "sum_Year": { "agg_type": "sum", "field": "Year" }, "count_Sport": { "agg_type": "count", "field": "Sport" } } } Response body:

image I expect the return result to be similar to the above doc

image

What is the problem, my data source and request parameters are consistent with the document? Thank you.

chenny avatar Jun 30 '23 07:06 chenny