Skip to content

Commit 94930b9

Browse files
meili-botStrift
andauthored
Changes related to Meilisearch v1.15.0 (#751)
* Update README.md * Add `disableOnNumbers` field to typo tolerance settings (#753) * Add disableOnNumbers field to typo tolerance settings * Update code samples --------- Co-authored-by: Laurent Cazanove <[email protected]>
1 parent e58c568 commit 94930b9

File tree

5 files changed

+13
-2
lines changed

5 files changed

+13
-2
lines changed

.code-samples.meilisearch.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,10 @@ typo_tolerance_guide_4: |-
417417
'twoTypos' => 10
418418
]
419419
]);
420+
typo_tolerance_guide_5: |-
421+
$client->index('movies')->updateTypoTolerance([
422+
'disableOnNumbers' => true
423+
]);
420424
add_movies_json_1: |-
421425
$moviesJson = file_get_contents('movies.json');
422426
$movies = json_decode($moviesJson);

src/Endpoints/Delegates/HandlesSettings.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,8 @@ public function resetSortableAttributes(): array
283283
* enabled: bool,
284284
* minWordSizeForTypos: array{oneTypo: int, twoTypos: int},
285285
* disableOnWords: list<non-empty-string>,
286-
* disableOnAttributes: list<non-empty-string>
286+
* disableOnAttributes: list<non-empty-string>,
287+
* disableOnNumbers: bool
287288
* }
288289
*/
289290
public function getTypoTolerance(): array
@@ -297,7 +298,8 @@ public function getTypoTolerance(): array
297298
* enabled: bool,
298299
* minWordSizeForTypos: array{oneTypo: int, twoTypos: int},
299300
* disableOnWords: list<non-empty-string>,
300-
* disableOnAttributes: list<non-empty-string>
301+
* disableOnAttributes: list<non-empty-string>,
302+
* disableOnNumbers: bool
301303
* } $typoTolerance
302304
*/
303305
public function updateTypoTolerance(array $typoTolerance): array

tests/Endpoints/IndexTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ public function testIndexGetSettings(): void
4747
'minWordSizeForTypos' => ['oneTypo' => 5, 'twoTypos' => 9],
4848
'disableOnWords' => [],
4949
'disableOnAttributes' => [],
50+
'disableOnNumbers' => false,
5051
],
5152
$this->index->getTypoTolerance(),
5253
);

tests/Settings/SettingsTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ final class SettingsTest extends TestCase
2525
],
2626
'disableOnWords' => [],
2727
'disableOnAttributes' => [],
28+
'disableOnNumbers' => false,
2829
];
2930

3031
public const DEFAULT_SEARCHABLE_ATTRIBUTES = ['*'];
@@ -123,6 +124,7 @@ public function testUpdateSettingsWithoutOverwritingThem(): void
123124
],
124125
'disableOnWords' => [],
125126
'disableOnAttributes' => [],
127+
'disableOnNumbers' => false,
126128
];
127129

128130
$index = $this->createEmptyIndex($this->safeIndexName());

tests/Settings/TypoToleranceTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ final class TypoToleranceTest extends TestCase
1919
],
2020
'disableOnWords' => [],
2121
'disableOnAttributes' => [],
22+
'disableOnNumbers' => false,
2223
];
2324

2425
protected function setUp(): void
@@ -44,6 +45,7 @@ public function testUpdateTypoTolerance(): void
4445
],
4546
'disableOnWords' => [],
4647
'disableOnAttributes' => ['title'],
48+
'disableOnNumbers' => true,
4749
];
4850
$promise = $this->index->updateTypoTolerance($newTypoTolerance);
4951
$this->index->waitForTask($promise['taskUid']);

0 commit comments

Comments
 (0)