Skip to content

Commit bdc7a72

Browse files
committed
rename whereTermFuzzy to whereFuzzy
1 parent 465ffe3 commit bdc7a72

File tree

6 files changed

+14
-16
lines changed

6 files changed

+14
-16
lines changed

src/Query/Builder.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,28 +1038,28 @@ public function orWhereNotTermsExists($column, $options = [])
10381038
*
10391039
* @param string $boolean
10401040
*/
1041-
public function whereTermFuzzy($column, $value, $boolean = 'and', $not = false, $options = []): self
1041+
public function whereFuzzy($column, $value, $boolean = 'and', $not = false, $options = []): self
10421042
{
1043-
$type = 'TermFuzzy';
1043+
$type = 'Fuzzy';
10441044
[$column, $value, $not, $boolean, $options] = $this->extractOptionsWithNot($type, $column, $value, $boolean, $not, $options);
10451045
$this->wheres[] = compact('column', 'value', 'type', 'boolean', 'not', 'options');
10461046

10471047
return $this;
10481048
}
10491049

1050-
public function orWhereTermFuzzy(string $column, $value, array $options = []): self
1050+
public function orWhereFuzzy(string $column, $value, array $options = []): self
10511051
{
1052-
return $this->whereTermFuzzy($column, $value, 'or', false, $options);
1052+
return $this->whereFuzzy($column, $value, 'or', false, $options);
10531053
}
10541054

1055-
public function whereNotTermFuzzy(string $column, $value, array $options = []): self
1055+
public function whereNotFuzzy(string $column, $value, array $options = []): self
10561056
{
1057-
return $this->whereTermFuzzy($column, $value, 'and', true, $options);
1057+
return $this->whereFuzzy($column, $value, 'and', true, $options);
10581058
}
10591059

1060-
public function orWhereNotTermFuzzy(string $column, $value, array $options = []): self
1060+
public function orWhereNotFuzzy(string $column, $value, array $options = []): self
10611061
{
1062-
return $this->whereTermFuzzy($column, $value, 'or', true, $options);
1062+
return $this->whereFuzzy($column, $value, 'or', true, $options);
10631063
}
10641064

10651065
/**

src/Query/Grammar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ protected function compileWherePhrasePrefix(Builder $builder, array $where): arr
648648
/**
649649
* Compile a term fuzzy clause
650650
*/
651-
protected function compileWhereTermFuzzy(Builder $builder, array $where): array
651+
protected function compileWhereFuzzy(Builder $builder, array $where): array
652652
{
653653

654654
$field = $where['column'];

src/Query/Options/FuzzyOptions.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
<?php
22

33
namespace PDPhilip\Elasticsearch\Query\Options;
4-
54
/**
6-
* @method $this fuzziness(string|int $value)
5+
* @method $this fuzziness(string $value)
76
* @method $this maxExpansions(int $value)
87
* @method $this prefixLength(int $value)
98
* @method $this transpositions(bool $value)

src/Query/Options/PhraseOptions.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
/**
66
* @method $this analyzer(string $analyzer)
7-
* @method $this maxExpansions(int $value)
87
* @method $this slop(int $value)
98
* @method $this zeroTermsQuery(string $value)
109
*/

tests/QueryElasticsearchSpecificTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
$users = User::whereTermExists('title')->get();
6868
expect($users)->toHaveCount(8);
6969

70-
$users = User::whereTermFuzzy('title', 'admik')->get();
70+
$users = User::whereFuzzy('title', 'admik')->get();
7171
expect($users)->toHaveCount(3);
7272

7373
// Was searchMatch()
@@ -87,7 +87,7 @@
8787
'seed' => 2,
8888
'field' => '_seq_no',
8989
], function (Builder $query) {
90-
$query->whereTermFuzzy('title.keyword', 'admik');
90+
$query->whereFuzzy('title.keyword', 'admik');
9191
})->get();
9292
expect($users)->toHaveCount(3);
9393
});

tests/WithIds/QueryElasticsearchSpecificTestWithId.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
$users = User::whereTermExists('title')->get();
6868
expect($users)->toHaveCount(8);
6969

70-
$users = User::whereTermFuzzy('title', 'admik')->get();
70+
$users = User::whereFuzzy('title', 'admik')->get();
7171
expect($users)->toHaveCount(3);
7272

7373
// Was searchMatch()
@@ -84,7 +84,7 @@
8484

8585
it('can use function score', function () {
8686
$users = User::functionScore('random_score', function (Builder $query) {
87-
$query->whereTermFuzzy('title.keyword', 'admik');
87+
$query->whereFuzzy('title.keyword', 'admik');
8888
})->get();
8989

9090
expect($users)->toHaveCount(2)

0 commit comments

Comments
 (0)