Skip to content

Commit

Permalink
fix fuzziness
Browse files Browse the repository at this point in the history
falsy value '0' would not pass to Es
  • Loading branch information
Spamercz committed Jun 16, 2021
1 parent 3cd91ac commit 0fb9cc3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Query/Match.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ public function toArray(): array
$array['match'][$this->field]['operator'] = $this->operator;
}

if ($this->fuzziness && $this->fuzziness->__toString()) {
if ($this->fuzziness !== NULL) {
$array['match'][$this->field]['fuzziness'] = $this->fuzziness->__toString();
}

if ($this->analyzer) {
if ($this->analyzer !== NULL) {
$array['match'][$this->field]['analyzer'] = $this->analyzer;
}

if ($this->minimumShouldMatch) {
if ($this->minimumShouldMatch !== NULL) {
$array['match'][$this->field]['minimum_should_match'] = $this->minimumShouldMatch;
}

Expand Down

0 comments on commit 0fb9cc3

Please sign in to comment.