Skip to content

Commit

Permalink
fix: require field to exist
Browse files Browse the repository at this point in the history
Otherwise date defaults to start of epoch, so we get lots of results for DOBs in January when customers just have no DOB set.
  • Loading branch information
Will Taylor-Jackson committed Dec 6, 2018
1 parent 0379a82 commit b6cdf22
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/QueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ protected function addDateBasedWhere($type, $column, $operator, $value, $boolean

$operator = $operator == '=' ? '==' : $operator;

$script = "doc.{$column}.date.{$dateType} {$operator} params.value";
$script = "doc.{$column}.size() > 0 && doc.{$column}.date.{$dateType} {$operator} params.value";

$options['params'] = ['value' => (int) $value];

Expand Down

0 comments on commit b6cdf22

Please sign in to comment.