diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/common/unit/TimeValue.java b/modules/elasticsearch/src/main/java/org/elasticsearch/common/unit/TimeValue.java index 13410a67637..085a09bd65e 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/common/unit/TimeValue.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/common/unit/TimeValue.java @@ -34,7 +34,7 @@ import java.io.Serializable; import java.util.concurrent.TimeUnit; /** - * @author kimchy (Shay Banon) + * @author kimchy (shay.banon) */ public class TimeValue implements Serializable, Streamable { @@ -231,8 +231,10 @@ public class TimeValue implements Serializable, Streamable { millis = (long) (Double.parseDouble(sValue.substring(0, sValue.length() - 1)) * 1000); } else if (sValue.endsWith("m")) { millis = (long) (Double.parseDouble(sValue.substring(0, sValue.length() - 1)) * 60 * 1000); - } else if (sValue.endsWith("H")) { + } else if (sValue.endsWith("H") || sValue.endsWith("h")) { millis = (long) (Double.parseDouble(sValue.substring(0, sValue.length() - 1)) * 60 * 60 * 1000); + } else if (sValue.endsWith("d")) { + millis = (long) (Double.parseDouble(sValue.substring(0, sValue.length() - 1)) * 24 * 60 * 60 * 1000); } else { millis = Long.parseLong(sValue); }