search: reindex command for all spaces

This commit is contained in:
ishabaral
2024-07-19 10:15:11 +05:45
parent 9fc37e7b81
commit a78d501fc0
3 changed files with 66 additions and 0 deletions
@@ -139,6 +139,35 @@ class CliContext implements Context {
$this->featureContext->setResponse(CliHelper::runCommand($body));
}
/**
* @When /^the administrator reindexes all spaces using the CLI$/
*
* @return void
*/
public function theAdministratorReindexesAllSpacesUsingTheCli(): void {
$command = "search index --all-spaces";
$body = [
"command" => $command
];
$this->featureContext->setResponse(CliHelper::runCommand($body));
}
/**
* @When /^the administrator reindexes a space "([^"]*)" using the CLI$/
*
* @param string $spaceName
*
* @return void
*/
public function theAdministratorReindexesASpaceUsingTheCli(string $spaceName): void {
$spaceId = $this->spacesContext->getSpaceIdByName($this->featureContext->getAdminUsername(), $spaceName);
$command = "search index --space $spaceId";
$body = [
"command" => $command
];
$this->featureContext->setResponse(CliHelper::runCommand($body));
}
/**
* @Then the command should be successful
*