Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/Integration/CommandsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions tests/Integration/SettingsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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']);
}
}
7 changes: 7 additions & 0 deletions tests/config/meili_search.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down