Skip to content

Commit 83dc2f8

Browse files
committed
remove temp-index-prefix option
1 parent 39dfd15 commit 83dc2f8

File tree

3 files changed

+3
-34
lines changed

3 files changed

+3
-34
lines changed

src/Command/MeilisearchImportCommand.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,6 @@ protected function configure(): void
8181
InputOption::VALUE_NONE,
8282
'Import to temporary indices and use index swap to prevent downtime'
8383
)
84-
->addOption(
85-
'temp-index-prefix',
86-
null,
87-
InputOption::VALUE_REQUIRED,
88-
'Prefix for temporary indices',
89-
self::TEMP_INDEX_PREFIX
90-
)
9184
;
9285
}
9386

@@ -103,7 +96,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
10396
$prefix = null;
10497

10598
if ($swapIndices) {
106-
$prefix = $input->getOption('temp-index-prefix') ?? self::TEMP_INDEX_PREFIX;
99+
$prefix = self::TEMP_INDEX_PREFIX;
107100
$config['prefix'] = $prefix.($config['prefix'] ?? '');
108101
}
109102

src/Services/SettingsUpdater.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function update(string $indice, ?int $responseTimeout = null, ?string $pr
4545
return;
4646
}
4747

48-
$indexName = $prefixedName ?: $index['prefixed_name'];
48+
$indexName = $prefixedName ?? $index['prefixed_name'];
4949
$indexInstance = $this->searchClient->index($indexName);
5050
$responseTimeout = $responseTimeout ?? self::DEFAULT_RESPONSE_TIMEOUT;
5151

tests/Integration/Command/MeilisearchImportCommandTest.php

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -406,36 +406,12 @@ public function testImportingIndexWithSwap(): void
406406

407407
$output = $commandTester->getDisplay();
408408
$this->assertStringContainsString('Importing for index Meilisearch\Bundle\Tests\Entity\Post', $output);
409-
$this->assertStringContainsString('Indexed a batch of '.$i.' / '.$i.' Meilisearch\Bundle\Tests\Entity\Post entities into _tmp_sf_phpunit__'.self::$indexName.' index ('.$i.' indexed since start)', $output);
409+
$this->assertStringContainsString('Indexed a batch of 6 / 6 Meilisearch\Bundle\Tests\Entity\Post entities into _tmp_sf_phpunit__'.self::$indexName.' index ('.$i.' indexed since start)', $output);
410410
$this->assertStringContainsString('Swapping indices...', $output);
411411
$this->assertStringContainsString('Indices swapped.', $output);
412412
$this->assertStringContainsString('Deleting temporary indices...', $output);
413413
$this->assertStringContainsString('Deleted _tmp_sf_phpunit__'.self::$indexName, $output);
414414
$this->assertStringContainsString('Done!', $output);
415415
$this->assertSame(0, $return);
416416
}
417-
418-
public function testImportingIndexWithSwapAndTempIndexPrefix(): void
419-
{
420-
for ($i = 0; $i <= 5; ++$i) {
421-
$this->createPost();
422-
}
423-
424-
$command = $this->application->find('meilisearch:import');
425-
$commandTester = new CommandTester($command);
426-
$return = $commandTester->execute([
427-
'--swap-indices' => true,
428-
'--temp-index-prefix' => '_temp_prefix_',
429-
]);
430-
431-
$output = $commandTester->getDisplay();
432-
$this->assertStringContainsString('Importing for index Meilisearch\Bundle\Tests\Entity\Post', $output);
433-
$this->assertStringContainsString('Indexed a batch of '.$i.' / '.$i.' Meilisearch\Bundle\Tests\Entity\Post entities into _temp_prefix_sf_phpunit__'.self::$indexName.' index ('.$i.' indexed since start)', $output);
434-
$this->assertStringContainsString('Swapping indices...', $output);
435-
$this->assertStringContainsString('Indices swapped.', $output);
436-
$this->assertStringContainsString('Deleting temporary indices...', $output);
437-
$this->assertStringContainsString('Deleted _temp_prefix_sf_phpunit__'.self::$indexName, $output);
438-
$this->assertStringContainsString('Done!', $output);
439-
$this->assertSame(0, $return);
440-
}
441417
}

0 commit comments

Comments
 (0)