{ "took": 47, "timed_out": false, "_shards": { "total": 475, "successful": 475, "skipped": 470, "failed": 0 }, "hits": { "total": 39906, "max_score": 0, "hits": [ ] }, "aggregations": { "aggTime": { "buckets": [ { "key": 1669881600000, "doc_count": 39877, "reportTypeTerm": { "doc_count_error_upper_bound": 0, "sum_other_doc_count": 0, "buckets": [ { "key": "domain", "doc_count": 39732 } , { "key": "device", "doc_count": 145 } ] } } , { "key": 1670310000000, "doc_count": 29, "reportTypeTerm": { "doc_count_error_upper_bound": 0, "sum_other_doc_count": 0, "buckets": [ { "key": "device", "doc_count": 29 } ] } } ] } } } 这是查询结果,并没有按照每小时进行统计
时间: 2023-07-30 18:11:14 浏览: 87
根据查询结果,返回的聚合结果按照每小时进行了统计。每个聚合桶(bucket)代表一个时间间隔。在第一个聚合桶中,key为1669881600000,doc_count为39877,表示这个时间间隔内有39877个文档。在这个时间间隔内的报告类型聚合中,有两个buckets:一个key为"domain",doc_count为39732;另一个key为"device",doc_count为145。在第二个聚合桶中,key为1670310000000,doc_count为29,表示这个时间间隔内有29个文档。在这个时间间隔内的报告类型聚合中,只有一个bucket:key为"device",doc_count为29。
请注意,由于我无法确定你的查询时间范围和数据情况,因此返回的结果可能只包含了部分数据。如果您希望每小时都有统计结果,请确保查询时间范围内存在相应的文档。
相关问题
{ "took": 1, "timed_out": false, "_shards": { "total": 2, "successful": 2, "skipped": 0, "failed": 0 }, "hits": { "total": { "value": 0, "relation": "eq" }, "max_score": null, "hits": [] } }
这是一个 Elasticsearch 查询的返回结果,其中包含以下信息:
- took:查询所花费的时间(以毫秒为单位)。
- timed_out:查询是否超时。
- _shards:分片相关的信息,包括总分片数、成功分片数、跳过的分片数和失败的分片数。
- hits:查询命中的文档相关的信息,包括文档总数、最高得分和命中的文档列表。
根据返回结果,该查询没有命中任何文档,因为“total”下的值为0。如果您期望有结果,可能需要调整查询语句或查询的索引名称。
{"took":199,"timed_out":false,"_shards":{"failed":0.0,"successful":1.0,"total":1.0,"skipped":0.0},"hits":{"total":{"relation":"eq","value":1},"hits":[{"_index":"products","_id":"bk-1","_score":0.2876821,"_source":"Product(id=bk-1, name=City bike, sku=123.0)"}],"max_score":0.2876821}}
这是一个搜索结果的信息,它告诉我们以下内容:
- "took": 199 表示搜索操作花费了199毫秒的时间。
- "timed_out": false 表示搜索操作没有超时。
- "_shards": 对于这个搜索操作,有1个分片成功地返回了结果,没有失败或跳过的分片。
- "hits": 搜索命中了1个文档,该文档的索引是"products",ID是"bk-1",得分是0.2876821。
- "_source": 搜索命中的文档的具体内容是"Product(id=bk-1, name=City bike, sku=123.0)"。
如果你还有其他问题,我会尽力回答!