0;
}
-sub castdate { +{"=" => {"transform" => "date", "value" => $_[0]}}; }
+sub castdate {
+ my ($value, $gte, $lte) = @_;
+
+ my $op = "=";
+ $op = ">=" if $gte;
+ $op = "<=" if $lte;
+
+ +{$op => {"transform" => "date", "value" => $value}};
+}
sub prepare_acqlia_search_and {
my ($acqlia) = @_;
$term->{"__fuzzy"} ? 1 : 0,
$term->{"__between"} ? 1 : 0,
$term->{"__not"} ? 1 : 0,
- $term->{"__castdate"} ? 1 : 0
+ $term->{"__castdate"} ? 1 : 0,
+ $term->{"__gte"} ? 1 : 0,
+ $term->{"__lte"} ? 1 : 0
);
}
$outer_clause->{$conj} = [] unless $outer_clause->{$conj};
foreach my $unit (@{$terms->{$class}}) {
- my ($k, $v, $fuzzy, $between, $not, $castdate) =
+ my ($k, $v, $fuzzy, $between, $not, $castdate, $gte, $lte) =
breakdown_term($unit);
my $term_clause;
} elsif ($between and could_be_range($v)) {
$term_clause = {$k => {"between" => $v}};
} elsif (check_1d_max($v)) {
- $v = castdate($v) if $castdate;
+ $v = castdate($v, $gte, $lte) if $castdate;
$term_clause = {$k => $v};
} else {
next;
can_do_fuzzy = false;
}
self.matchHowAllow(id, "__fuzzy", can_do_fuzzy);
+
+ var inequalities = (term.datatype == "timestamp");
+ self.matchHowAllow(id, "__gte", inequalities);
+ self.matchHowAllow(id, "__lte", inequalities);
}
);
};
<td name="match"
class="acq-unified-terms-match">
<select>
- <option value="">matches exactly</option>
- <option value="__not">
- does NOT match exactly
- </option>
+ <option value="">is</option>
+ <option value="__not">is NOT</option>
<option value="__fuzzy">contains</option>
<option value="__not,__fuzzy">
does NOT contain
</option>
+ <option value="__lte">
+ is on or BEFORE
+ </option>
+ <option value="__gte">
+ is on or AFTER
+ </option>
</select>
</td>
<td name="widget"