有类似传感器的设备,上传主要数据如下,每条数据都有时间:
[status:1,temperature:20,date:20160101]
[status:1,temperature:21,date:20160101]
[status:1,temperature:21,date:20160101]
[status:1,temperature:21,date:20160101]
[status:2,temperature:5,date:20160101]
[status:2,temperature:5,date:20160101]
[status:2,temperature:5,date:20160101]
[status:1,temperature:21,date:20160101]
[status:1,temperature:21,date:20160101]
希望得到不同status下的temperature列表,并分页
[status:1,temperature[20,21,21,21]]
[status:2,temperature[5,5,5]]
[status:1,temperature[21,21]]
想请教一下用elasticsearch如何存储能做到,之前想过直接把列表直接存储成文档,但是如果需要按每天聚合就有些麻烦,如avgTemperature(date)
[status:1,temperature:20,date:20160101]
[status:1,temperature:21,date:20160101]
[status:1,temperature:21,date:20160101]
[status:1,temperature:21,date:20160101]
[status:2,temperature:5,date:20160101]
[status:2,temperature:5,date:20160101]
[status:2,temperature:5,date:20160101]
[status:1,temperature:21,date:20160101]
[status:1,temperature:21,date:20160101]
希望得到不同status下的temperature列表,并分页
[status:1,temperature[20,21,21,21]]
[status:2,temperature[5,5,5]]
[status:1,temperature[21,21]]
想请教一下用elasticsearch如何存储能做到,之前想过直接把列表直接存储成文档,但是如果需要按每天聚合就有些麻烦,如avgTemperature(date)
0 个回复