Skip to content

Commit a7077ee

Browse files
committed
SearchCutoffMs setting
1 parent 08684f0 commit a7077ee

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
lines changed

src/DependencyInjection/Configuration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function getConfigTreeBuilder(): TreeBuilder
6464
->beforeNormalization()
6565
->always()
6666
->then(static function (array $value) {
67-
$stringSettings = ['distinctAttribute', 'proximityPrecision'];
67+
$stringSettings = ['distinctAttribute', 'proximityPrecision', 'searchCutoffMs'];
6868

6969
foreach ($stringSettings as $setting) {
7070
if (isset($value[$setting]) && !is_array($value[$setting])) {

src/Services/SettingsUpdater.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function update(string $indice, ?int $responseTimeout = null): void
5858

5959
if (isset($value['_service']) && $value['_service'] instanceof SettingsProvider) {
6060
$value = $value['_service']();
61-
} elseif (('distinctAttribute' === $variable || 'proximityPrecision' === $variable) && is_array($value)) {
61+
} elseif (('distinctAttribute' === $variable || 'proximityPrecision' === $variable || 'searchCutoffMs' === $variable) && is_array($value)) {
6262
$value = $value[0] ?? null;
6363
}
6464

tests/Integration/CommandsTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ public function testSearchImportAndClearAndDeleteWithoutIndices(): void
7575
Settings updated of "sf_phpunit__posts".
7676
Settings updated of "sf_phpunit__posts".
7777
Settings updated of "sf_phpunit__posts".
78+
Settings updated of "sf_phpunit__posts".
7879
Importing for index Meilisearch\Bundle\Tests\Entity\Comment
7980
Importing for index Meilisearch\Bundle\Tests\Entity\Tag
8081
Indexed a batch of 6 / 6 Meilisearch\Bundle\Tests\Entity\Tag entities into sf_phpunit__tags index (6 indexed since start)
@@ -383,6 +384,7 @@ public function testSearchCreateWithoutIndices(bool $updateSettings): void
383384
Settings updated of "sf_phpunit__posts".
384385
Settings updated of "sf_phpunit__posts".
385386
Settings updated of "sf_phpunit__posts".
387+
Settings updated of "sf_phpunit__posts".
386388
Creating index sf_phpunit__comments for Meilisearch\Bundle\Tests\Entity\Comment
387389
Creating index sf_phpunit__tags for Meilisearch\Bundle\Tests\Entity\Tag
388390
Creating index sf_phpunit__tags for Meilisearch\Bundle\Tests\Entity\Link
@@ -434,6 +436,7 @@ public function testSearchCreateWithIndices(): void
434436
Settings updated of "sf_phpunit__posts".
435437
Settings updated of "sf_phpunit__posts".
436438
Settings updated of "sf_phpunit__posts".
439+
Settings updated of "sf_phpunit__posts".
437440
Done!
438441

439442
EOD, $createOutput);

tests/config/meilisearch.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ meilisearch:
1111
settings:
1212
stopWords: ['the', 'a', 'an']
1313
filterableAttributes: ['title', 'publishedAt']
14+
searchCutoffMs: 1500
1415
typoTolerance:
1516
enabled: true
1617
disableOnAttributes: ['title']

0 commit comments

Comments
 (0)