Home > Back-end >  Elasticsearch: date_histogram interval
Elasticsearch: date_histogram interval

Time:11-19

Companies use elasticsearch recently some cached data access, now there is a demand to get 2 hours specified data, elasticsearch date_histogram interval of the field is a specified interval of time within 2 hours specified data aggregation, such as


2 hours per 3 minutes in the data for a bucket, and the results of the first barrel and the time is right, the end of the barrel of the time is right,
But I change the time to 4 minutes, the first barrel will move forward for a few minutes of time, end time also moved forward for a few minutes, ever encountered bosses, solving!!!!!!!!!!

CodePudding user response:

The formula for computing es barrels polymerization bucket_key bucket_key=math.h floor ((value - offset)/interval) * interval + offset
End time forward migration may be less time there is no data inside,

CodePudding user response:

Missing this time without the data, forced return empty barrels, also should have a bucket,

CodePudding user response:

What ah, the value represents the offset that I to know

CodePudding user response:

refer to the second floor qq_35303368 response:
missing this time without the data, forced return empty barrels, also should have a bucket,

I really don't know this, I use there is no question of es Java API,



reference qq_35303368 reply: 3/f
value represents what ah, I to offset that know

Is the from Unix timestamp,

CodePudding user response:

The value of no value feeling, API to write not see don't understand

CodePudding user response:

reference 1st floor Braska response:
es bucket_key barrels polymerization formula is calculated by bucket_key=math.h floor ((value - offset)/interval) * interval + offset
End time forward migration may be less time there is no data inside,


The formula how to calculate sometimes inaccurate?? Sometimes can be accurate

CodePudding user response:

Bosses may I have your problem solved I query the statistical data in two hours of the day should be from 00 to 24 PM but he was a day of 16 PM query until 4 o 'clock the next day,,, but the data is right, except for a few more, and this should be how to solve,,

CodePudding user response:

8 hours time zone difference

CodePudding user response:

refer to 7th floor Cai_javaXiaoFan response:
bosses may I have your problem solved I query the statistical data in two hours of the day should be from 00 to 24 PM but he was a day of 16 PM query until 4 o 'clock the next day,,, but the data is right, except for a few more, and this should be how to solve,,
8 hours time zone difference
  • Related