Class DateRelative
- All Implemented Interfaces:
Serializable
Can be used in three cases with different meanings:
(1) Provides relative time differences for DateNowValues in search queries.
If a range query into the past or future is performed, is defined if the biggest delivered value
is positive or negative.
e.g.: If year=0, month=-2
, a range query from now to two months into the past is
performed.
e.g.: If year=0, month=-2, days=10
, a range query from now to one month, 20 days
into the past is performed.
(2) Provides optional time offset for date histogram aggregations.
Here, the time unit must be smaller than the requested calendar interval unit and it is only one
field allowed which not equals to zero. So, you cannot add values with different units like in
search queries.
e.g.: If the requested interval is "day", the offset unit can only be smaller than day, e.g.
"hour".
(3) Provides date math for optional "extended boundary" and "hard boundary" parameters for date histogram aggregations.
Here, it is only one field allowed which not equals to zero. So, you cannot add values with
different units like in search queries.
- Since:
- 11.00.000.002
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
year
protected int yearTime shift for years.
example: -3 means three years to the past. 3 means three years to the future. -
month
protected int monthTime shift for months.
example: -3 means three months to the past. 3 means three months to the future. -
day
protected int dayTime shift for days.
example: -3 means three days to the past. 3 means three days to the future. -
hour
protected int hourTime shift for hours.
example: -3 means three hours to the past. 3 means three hours to the future. -
minute
protected int minuteTime shift for minutes.
example: -3 means three minutes to the past. 3 means three minutes to the future.
-
-
Constructor Details
-
DateRelative
public DateRelative()
-
-
Method Details
-
getYear
public int getYear() -
getMonth
public int getMonth() -
getDay
public int getDay() -
getHour
public int getHour() -
getMinute
public int getMinute() -
setYear
public void setYear(int year) -
setMonth
public void setMonth(int month) -
setDay
public void setDay(int day) -
setHour
public void setHour(int hour) -
setMinute
public void setMinute(int minute) -
toString
-