Re: Proper parsing of String values like 1m, 1q HOUR etc.

2014-06-25 Thread Thomas
Hi, Thanks again for your time, what I'm trying to do is to be able to generate for example the time in milliseconds in the same way the elasticsearch core does when for example you passes into the date histogram the 1q configuration. I'm trying to simulate in a way the interval of date histog

Re: Proper parsing of String values like 1m, 1q HOUR etc.

2014-06-24 Thread Brian
Thomas, The TimeValue class handles precisely defined time periods (well, pretty much, anyway). In other words, 1s is one second. 1w is always 7d (leap seconds notwithstanding, but that doesn't really affect the precision). But what is one year? 365 days? 365.25 days? 366 days in a leap year?

Re: Proper parsing of String values like 1m, 1q HOUR etc.

2014-06-24 Thread Thomas
Hi Brian, Thanks for your reply, I understand your point but if you check the source code of TimeValue it does not support the quarter and the year so I was wondering what is the class that supports the transformation of the string 1q into millisecods or 1y into millisecods if any Thanks On T

Re: Proper parsing of String values like 1m, 1q HOUR etc.

2014-06-23 Thread Brian
1w means one week, 12.3d means 12.3 days, 52w means 52 weeks, 4h means 4 hours, 12.3ms means 12.3 milliseconds, 12 means 12 milliseconds but without the suffix the value must be an integer. In other words, TimeValue supports the parsing of a String that contains a long integer digit string to m

Proper parsing of String values like 1m, 1q HOUR etc.

2014-06-17 Thread Thomas
Hi, I was wondering whether there is a proper Utility class to parse the given values and get the duration in milliseconds probably for values such as 1m (which means 1 minute) 1q (which means 1 quarter) etc. I have found that elasticsearch utilizes class TimeValue but it only parses up to wee