You are here

function apachesolr_drush_command in Apache Solr Search 6.2

Same name and namespace in other branches
  1. 8 drush/apachesolr.drush.inc \apachesolr_drush_command()
  2. 5.2 apachesolr.drush.inc \apachesolr_drush_command()
  3. 6.3 drush/apachesolr.drush.inc \apachesolr_drush_command()
  4. 6 drush/apachesolr.drush.inc \apachesolr_drush_command()
  5. 7 drush/apachesolr.drush.inc \apachesolr_drush_command()

Implementation of hook_drush_command().

In this hook, you specify which commands your drush module makes available, what it does and description.

Notice how this structure closely resembles how you define menu hooks.

Return value

An associative array describing your command(s).

See also

drush_parse_command() for a list of recognized keys.

File

drush/apachesolr.drush.inc, line 23
drush integration for apachesolr.

Code

function apachesolr_drush_command() {
  $items = array();

  // the key in the $items array is the name of the command.
  $items['solr-delete-index'] = array(
    // the name of the function implementing your command.
    'callback' => 'apachesolr_drush_solr_delete_index',
    // a short description of your command
    '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.'),
    ),
  );
  $items['solr-reindex'] = array(
    // the name of the function implementing your command.
    'callback' => 'apachesolr_drush_solr_reindex',
    // a short description of your command
    '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.'),
    ),
  );
  $items['solr-index'] = array(
    // the name of the function implementing your command.
    'callback' => 'apachesolr_drush_solr_index',
    // a short description of your command
    'description' => dt('Reindexes content marked for (re)indexing.'),
  );
  $items['solr-phpclient'] = array(
    'callback' => 'apachesolr_drush_solr_phpclient',
    'description' => dt('Downloads the required SolrPhpClient from googlecode.com.'),
    'arguments' => array(
      'path' => dt('Optional. A path to the apachesolr module. If omitted Drush will use the default location.'),
    ),
  );
  $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.'),
    ),
  );
  return $items;
}