function apachesolr_drush_solr_search in Apache Solr Search 5.2
Same name and namespace in other branches
- 8 drush/apachesolr.drush.inc \apachesolr_drush_solr_search()
- 6.3 drush/apachesolr.drush.inc \apachesolr_drush_solr_search()
- 6 drush/apachesolr.drush.inc \apachesolr_drush_solr_search()
- 6.2 drush/apachesolr.drush.inc \apachesolr_drush_solr_search()
- 7 drush/apachesolr.drush.inc \apachesolr_drush_solr_search()
1 string reference to 'apachesolr_drush_solr_search'
- apachesolr_drush_command in ./
apachesolr.drush.inc - Implementation of hook_drush_command().
File
- ./
apachesolr.drush.inc, line 141 - drush integration for apachesolr.
Code
function apachesolr_drush_solr_search() {
$args = func_get_args();
$keys = implode(' ', $args);
foreach (apachesolr_search_execute($keys, '', '') as $result) {
$output = 'node/' . $result['node']->nid . ' ' . dt('by @name (user/@uid)', array(
'@name' => strip_tags($result['user']),
'@uid' => $result['node']->uid,
)) . "\n";
$output .= dt('title: ') . $result['title'] . "\n";
$output .= preg_replace('/[\\s]+/', ' ', strip_tags($result['snippet'])) . "\n\n";
drush_print($output);
}
}