forked from yhahn/searchlight
-
Notifications
You must be signed in to change notification settings - Fork 0
/
searchlight.drush.inc
60 lines (55 loc) · 1.55 KB
/
searchlight.drush.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
// $Id$
/**
* Implements hook_drush_command().
*/
function searchlight_drush_command() {
$items = array();
$items['searchlight-conf'] = array(
'callback' => 'drush_searchlight_conf',
'description' => 'Set the Searchlight configuration for the current site.',
'drupal dependencies' => array('searchlight'),
);
$items['searchlight-index'] = array(
'callback' => 'drush_searchlight_index',
'description' => 'Re-generate the Searchlight index for the current site.',
'drupal dependencies' => array('searchlight'),
);
$items['searchlight-searchd'] = array(
'callback' => 'drush_searchlight_searchd',
'description' => 'Start the backend search daemon for the current site.',
'drupal dependencies' => array('searchlight'),
'options' => array(
'--sl-jar-path=path' => 'Solr: Full path to the Apache Solr application to be used.',
),
);
return $items;
}
/**
* Generate the configuration file for the current site.
*/
function drush_searchlight_conf() {
$backend = searchlight_get_backend();
$backend->drushConf();
}
/**
* Generate new indexes for the current site.
*/
function drush_searchlight_index() {
$backend = searchlight_get_backend();
$backend->drushIndex();
}
/**
* Start or stop the search daemon.
*/
function drush_searchlight_searchd($command = 'start') {
$backend = searchlight_get_backend();
$backend->drushSearchd($command);
}
/**
* After cron has been run succesfully.
*/
function drush_searchlight_post_core_cron() {
$backend = searchlight_get_backend();
$backend->drushCron();
}