Skip to content

Commit

Permalink
Problems with range searches for time with lte
Browse files Browse the repository at this point in the history
  • Loading branch information
kimchy committed Mar 6, 2013
1 parent 4b2070b commit fb10cc6
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -198,7 +198,11 @@ private long parseStringValue(String value) {

private long parseUpperInclusiveStringValue(String value) {
try {
MutableDateTime dateTime = new MutableDateTime(3000, 12, 31, 23, 59, 59, 999, DateTimeZone.UTC);
// we create a date time for inclusive upper range, we "include" by default the day level data
// so something like 2011-01-01 will include the full first day of 2011.
// we also use 1970-01-01 as the base for it so we can handle searches like 10:12:55 (just time)
// since when we index those, the base is 1970-01-01
MutableDateTime dateTime = new MutableDateTime(1970, 1, 1, 23, 59, 59, 999, DateTimeZone.UTC);
int location = dateTimeFormatter.parser().parseInto(dateTime, value, 0);
// if we parsed all the string value, we are good
if (location == value.length()) {
Expand Down

0 comments on commit fb10cc6

Please sign in to comment.