diff --git a/src/DesignMyNight/Elasticsearch/QueryGrammar.php b/src/DesignMyNight/Elasticsearch/QueryGrammar.php index 79dce6d..6d22d90 100644 --- a/src/DesignMyNight/Elasticsearch/QueryGrammar.php +++ b/src/DesignMyNight/Elasticsearch/QueryGrammar.php @@ -487,6 +487,11 @@ protected function compileWhereSearch(Builder $builder, array $where): array ]; } + if (!empty($where['options']['fuzziness'])) { + $firstKey = array_keys($query)[0]; + $query[$firstKey]['fuzziness'] = (int) $where['options']['fuzziness']; + } + return $query; }