Skip to content
This repository was archived by the owner on Apr 1, 2024. It is now read-only.

Commit 3fb5ad3

Browse files
Update README.md
1 parent bb1941a commit 3fb5ad3

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,9 @@ User::whereFuzzy(function ($query) {
114114
})->get();
115115
```
116116

117-
When searching large tables to only confirm whether matches exist, removing sorting and relevance checking will significantly increase query performance. To adjust the relevance threshold you can filter the relevance data Manually
117+
### Performance (large datasets)
118+
119+
When searching large tables to only confirm whether matches exist, removing sorting and relevance checking will significantly increase query performance. To do this, simply supply `false` as a third parameter for the `whereFuzzy` or `orWhereFuzzy` methods:
118120

119121
```php
120122
DB::table('users')
@@ -123,17 +125,21 @@ DB::table('users')
123125
->first();
124126
```
125127

126-
When searching large tables, removing matchers will significantly increase query performance.
128+
To adjust the relevance threshold you can filter the relevance data manually if needed.
129+
130+
You can also further improve performance by selectively disabling one or more pattern matchers. Simply supply an `array` of pattern matchers you want to disable as the fourth parameter e.g.
127131

128132
```php
129133
DB::table('users')
130-
->whereFuzzy('name', 'jd', [
134+
->whereFuzzy('name', 'jd', true, [
131135
'AcronymMatcher',
132136
'StudlyCaseMatcher',
133137
]);
134138
->first();
135139
```
136-
#### Matchers
140+
141+
The following pattern matchers can be included in the `array`:
142+
137143
- ExactMatcher
138144
- StartOfStringMatcher
139145
- AcronymMatcher
@@ -143,6 +149,7 @@ DB::table('users')
143149
- InStringMatcher
144150
- TimesInStringMatcher
145151

152+
Review the `/src/Matchers` directory to see what each matcher does for a query.
146153

147154
## Limitations
148155

0 commit comments

Comments
 (0)