diff --git a/tests/Integration/CommandsTest.php b/tests/Integration/CommandsTest.php index e912e63d..8d31ef4c 100644 --- a/tests/Integration/CommandsTest.php +++ b/tests/Integration/CommandsTest.php @@ -77,6 +77,7 @@ public function testSearchImportAndClearAndDeleteWithoutIndices(): void Indexed 6 / 6 MeiliSearch\Bundle\Test\Entity\Post entities into sf_phpunit__aggregated index Settings updated. Settings updated. +Settings updated. Importing for index MeiliSearch\Bundle\Test\Entity\Comment Importing for index MeiliSearch\Bundle\Test\Entity\Tag Indexed 6 / 6 MeiliSearch\Bundle\Test\Entity\Tag entities into sf_phpunit__tags index diff --git a/tests/Integration/SettingsTest.php b/tests/Integration/SettingsTest.php index 1bc6092b..70126296 100644 --- a/tests/Integration/SettingsTest.php +++ b/tests/Integration/SettingsTest.php @@ -6,6 +6,7 @@ use MeiliSearch\Bundle\Test\BaseKernelTestCase; use MeiliSearch\Client; +use MeiliSearch\Contracts\Index\TypoTolerance; use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Component\Console\Tester\CommandTester; @@ -60,5 +61,12 @@ public function testUpdateSettings(): void $this->assertNotEmpty($settings['filterableAttributes']); $this->assertEquals(['publishedAt', 'title'], $settings['filterableAttributes']); + + $this->assertArrayHasKey('typoTolerance', $settings); + $this->assertInstanceOf(TypoTolerance::class, $settings['typoTolerance']); + $this->assertTrue($settings['typoTolerance']['enabled']); + $this->assertEquals(['title'], $settings['typoTolerance']['disableOnAttributes']); + $this->assertEquals(['york'], $settings['typoTolerance']['disableOnWords']); + $this->assertEquals(['oneTypo' => 5, 'twoTypos' => 9], $settings['typoTolerance']['minWordSizeForTypos']); } } diff --git a/tests/config/meili_search.yaml b/tests/config/meili_search.yaml index 323562d2..461454bd 100644 --- a/tests/config/meili_search.yaml +++ b/tests/config/meili_search.yaml @@ -11,6 +11,13 @@ meili_search: settings: stopWords: ['the', 'a', 'an'] filterableAttributes: ['title', 'publishedAt'] + typoTolerance: + enabled: true + disableOnAttributes: ['title'] + disableOnWords: ['york'] + minWordSizeForTypos: + oneTypo: 5 + twoTypos: 9 - name: comments class: 'MeiliSearch\Bundle\Test\Entity\Comment' - name: aggregated