class SearchApiSolrCommands in Search API Solr 8.2
Same name and namespace in other branches
- 8.3 src/Commands/SearchApiSolrCommands.php \Drupal\search_api_solr\Commands\SearchApiSolrCommands
- 4.x src/Commands/SearchApiSolrCommands.php \Drupal\search_api_solr\Commands\SearchApiSolrCommands
Defines Drush commands for the Search API Solr.
Hierarchy
- class \Drupal\search_api_solr\Commands\SearchApiSolrCommands extends \Drush\Commands\DrushCommands
Expanded class hierarchy of SearchApiSolrCommands
1 string reference to 'SearchApiSolrCommands'
1 service uses SearchApiSolrCommands
File
- src/
Commands/ SearchApiSolrCommands.php, line 13
Namespace
Drupal\search_api_solr\CommandsView source
class SearchApiSolrCommands extends DrushCommands {
/**
* The command helper.
*
* @var \Drupal\search_api_solr\Utility\CommandHelper
*/
protected $commandHelper;
/**
* Constructs a SearchApiCommands object.
*
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entityTypeManager
* The entity type manager.
*/
public function __construct(EntityTypeManagerInterface $entityTypeManager) {
$this->commandHelper = new CommandHelper($entityTypeManager);
}
/**
* {@inheritdoc}
*/
public function setLogger(LoggerInterface $logger) {
parent::setLogger($logger);
$this->commandHelper
->setLogger($logger);
}
/**
* Lists all search indexes.
*
* @command search-api-solr:reinstall-fieldtypes
*
* @usage drush search-api-solr:reinstall-fieldtypes
* Deletes all Solr Field Type and re-installs them from their yml files.
*
* @aliases solr-reinstall-ft,sasm-reinstall-ft,search-api-solr-delete-and-reinstall-all-field-types,search-api-solr-multilingual-delete-and-reinstall-all-field-types
*
* @throws \Drupal\search_api\SearchApiException
* Thrown if an index has a server which couldn't be loaded.
*/
public function reinstallFieldtypes() {
$this->commandHelper
->reinstallFieldtypesCommand();
}
/**
* Enables one disabled search index.
*
* @param string $server_id
* The ID of the server.
* @param string $file_name
* The file name of the config zip that should be created.
* @param string $solr_version
* The targeted Solr version.
*
* @command search-api-solr:get-server-config
*
* @usage drush search-api-solr:get-server-config server_id file_name
* Get the config files for a solr server and save it as zip file.
*
* @aliases solr-gsc,sasm-gsc,search-api-solr-get-server-config,search-api-solr-multilingual-get-server-config
*
* @throws \Drupal\search_api\ConsoleException
* Thrown if no indexes could be loaded.
*/
public function getServerConfig($server_id, $file_name, $solr_version = NULL) {
$this->commandHelper
->getServerConfigCommand($server_id, $file_name, $solr_version);
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
SearchApiSolrCommands:: |
protected | property | The command helper. | |
SearchApiSolrCommands:: |
public | function | Enables one disabled search index. | |
SearchApiSolrCommands:: |
public | function | Lists all search indexes. | |
SearchApiSolrCommands:: |
public | function | ||
SearchApiSolrCommands:: |
public | function | Constructs a SearchApiCommands object. |