function apachesolr_drush_solr_search in Apache Solr Search 6.3
Same name and namespace in other branches
- 8 drush/apachesolr.drush.inc \apachesolr_drush_solr_search()
- 5.2 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 drush/
apachesolr.drush.inc - Implements hook_drush_command().
File
- drush/
apachesolr.drush.inc, line 285 - drush integration for apachesolr.
Code
function apachesolr_drush_solr_search() {
$args = func_get_args();
$keys = implode(' ', $args);
foreach (apachesolr_search_search_execute($keys) as $result) {
$output = $result['fields']['path'];
if (isset($result['user']) && isset($result['node']->is_uid)) {
$output .= ' ' . dt('by @name (user/@uid)', array(
'@name' => strip_tags($result['user']),
'@uid' => $result['node']->is_uid,
));
}
$output .= "\n";
$output .= dt('title: ') . $result['title'] . "\n";
$output .= trim(preg_replace('/\\s+/', ' ', strip_tags($result['snippet']))) . "\n\n";
drush_print($output);
}
}