function apachesolr_drush_command in Apache Solr Search 7
Same name and namespace in other branches
- 8 drush/apachesolr.drush.inc \apachesolr_drush_command()
- 5.2 apachesolr.drush.inc \apachesolr_drush_command()
- 6.3 drush/apachesolr.drush.inc \apachesolr_drush_command()
- 6 drush/apachesolr.drush.inc \apachesolr_drush_command()
- 6.2 drush/apachesolr.drush.inc \apachesolr_drush_command()
Implements hook_drush_command().
Return value
array An associative array describing your command(s).
File
- drush/
apachesolr.drush.inc, line 14 - drush integration for apachesolr.
Code
function apachesolr_drush_command() {
$items = array();
$items['solr-delete-index'] = array(
'callback' => 'apachesolr_drush_solr_delete_index',
'description' => dt('Deletes the content from the index. Can take content types as parameters.'),
'arguments' => array(
'types' => dt('Optional. A space delimited list of content types to be deleted from the index.'),
),
'options' => array(
'environment-id' => 'The environment ID',
),
'examples' => array(
'drush solr-delete-index node' => 'Delete all node content from the index.',
'drush solr-delete-index node:article' => 'Delete all content of the article content type from the index.',
'drush solr-delete-index node:article node:blog' => 'Delete all content of the article and blog content types from the index.',
),
);
$items['solr-mark-all'] = array(
'callback' => 'apachesolr_drush_solr_mark_for_reindex',
'description' => dt('Marks content for reindexing. Can take content types as parameters.'),
'arguments' => array(
'types' => dt('Optional. A space delimited list of content types to be marked for reindexing.'),
),
'options' => array(
'environment-id' => 'The environment ID',
),
);
$items['solr-index'] = array(
'callback' => 'apachesolr_drush_solr_index',
'description' => dt('Reindexes content marked for (re)indexing. You must supply the -l (--uri) parameter if $base_url is not set in settings.php.'),
'options' => array(
'environment-id' => 'The environment ID',
'limit' => 'The total number of documents to index',
),
);
$items['solr-get-last-indexed'] = array(
'callback' => 'apachesolr_drush_solr_get_last_indexed',
'description' => dt('Get the ID of the last document indexed.'),
'arguments' => array(
'environment-id' => dt('Optional. The environment ID, uses the default if not passed.'),
'entity-type' => dt('Optional. The machine name of the entity, defaults to "node".'),
),
);
$items['solr-get-next-indexed'] = array(
'callback' => 'apachesolr_drush_solr_get_next_indexed',
'description' => dt('Get the ID of the next document to be indexed.'),
'arguments' => array(
'environment-id' => dt('Optional. The environment ID, uses the default if not passed.'),
'entity-type' => dt('Optional. The machine name of the entity, defaults to "node".'),
),
);
$items['solr-search'] = array(
'callback' => 'apachesolr_drush_solr_search',
'description' => dt('Search the site for keywords using Apache Solr'),
'arguments' => array(
'keywords' => dt('One or more keywords, separated by spaces.'),
),
);
$items['solr-get-env-id'] = array(
'callback' => 'apachesolr_drush_solr_get_env_id',
'description' => dt('Get the default Apache Solr environment ID, or all IDs and names'),
'arguments' => array(),
'options' => array(
'all' => array(
'description' => 'List all environment IDs',
),
),
);
$items['solr-get-env-name'] = array(
'callback' => 'apachesolr_drush_solr_get_env_name',
'description' => dt('Get the Apache Solr environment name.'),
'options' => array(
'id' => array(
'description' => 'Apache Solr environment ID to use (uses the default environment if not specified)',
),
),
);
$items['solr-get-env-url'] = array(
'callback' => 'apachesolr_drush_solr_get_env_url',
'description' => dt('Get the Apache Solr environment url.'),
'options' => array(
'id' => array(
'description' => 'Apache Solr environment ID to use (uses the default environment if not specified)',
),
),
);
$items['solr-set-env-url'] = array(
'callback' => 'apachesolr_drush_solr_set_env_url',
'description' => dt('Set the url for an Apache Solr environment.'),
'arguments' => array(
'url' => dt('Apache Solr server url string.'),
),
'required-arguments' => TRUE,
'options' => array(
'id' => array(
'description' => 'Apache Solr environment ID to use (uses the default environment if not specified)',
),
),
);
$items['solr-variable-get'] = array(
'description' => 'Get a list of Apache Solr environment variable names and values.',
'arguments' => array(
'name' => 'A string to filter the variables by. Variables that have any part of their name matching the string will be listed.',
),
'examples' => array(
'drush solr-vget' => 'List all variables and values.',
'drush solr-vget user' => 'List all variables containing the string "user".',
),
'options' => array(
'id' => 'Apache Solr environment ID to use (uses the default environment if not specified)',
'format' => 'Format to output the object. Use "print_r" for print_r (default), "export" for var_export, and "json" for JSON.',
'pipe' => 'A synonym for --format=export. Useful for pasting into code.',
),
'aliases' => array(
'solr-vget',
),
);
$items['solr-variable-set'] = array(
'description' => 'Set an Apache Solr environment variable.',
'arguments' => array(
'name' => 'The name of a variable or the first few letters of its name.',
'value' => 'The value to assign to the variable. Use \'-\' to read the object from STDIN.',
),
'required-arguments' => TRUE,
'options' => array(
'id' => 'Apache Solr environment ID to use (uses the default environment if not specified)',
'yes' => 'Skip confirmation if only one variable name matches.',
'always-set' => 'Always skip confirmation.',
'format' => 'Format to parse the object. Use "auto" to detect format from value (default), "string", "integer" or "boolean" for corresponding primitive type, and "json" for JSON.',
),
'examples' => array(
'drush solr-vset --yes apachesolr_read_only 1' => 'Set the apachesolr_read_only variable to 1. Skip confirmation if variable already exists.',
'drush solr-vset pr TRUE' => 'Choose from a list of variables beginning with "pr" to set to (bool)true.',
'php -r "print json_encode(array(\'drupal\', \'simpletest\'));" | drush solr-vset --format=json project_dependency_excluded_dependencies -' => 'Set a variable to a complex value (e.g. array)',
),
'aliases' => array(
'solr-vset',
),
);
$items['solr-variable-delete'] = array(
'description' => 'Delete an Apache Solr environment variable.',
'arguments' => array(
'name' => 'The name of a variable or the first few letters of its name.',
),
'required-arguments' => TRUE,
'options' => array(
'id' => array(
'description' => 'Apaches Solr environment ID to use (uses the default environment if not specified)',
),
'yes' => 'Skip confirmation if only one variable name matches.',
'exact' => 'Only delete the one variable that exactly matches the specified name.',
),
'examples' => array(
'drush solr-vdel apachesolr_read_only --id=solr2' => 'Delete the apachesolr_read_only variable for the solr2 environment.',
'drush solr-vdel apa' => 'Choose from a list of variables beginning with "apa" to delete.',
'drush solr-vdel -y --exact apachesolr_read_only' => 'Delete variable, skipping confirmation.',
),
'aliases' => array(
'solr-vdel',
),
);
return $items;
}