Index: services/search_service/search_service.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/services/services/search_service/Attic/search_service.inc,v
retrieving revision 1.1.2.4
diff -u -p -r1.1.2.4 search_service.inc
--- services/search_service/search_service.inc	12 Jan 2009 06:59:00 -0000	1.1.2.4
+++ services/search_service/search_service.inc	13 Feb 2009 18:22:52 -0000
@@ -40,6 +40,49 @@ function search_service_nodes($keys, $si
 }
 
 /**
+ * Callback for search.content service.
+ */
+function search_service_content($keys, $simple = FALSE) {
+  // define standard keys for simple set
+  $stdkeys = array('link', 'type', 'title', 'user', 'date', 'snippet');
+
+  // invoke the search hook to generate results
+  $results = array();
+  $search_hooks = variable_get('search_service_options', 'apachesolr_search');
+
+  watchdog('search_service', t('search.content invoked for !keys using hooks !hooks', array('!keys' => $keys, '!hooks' => implode($search_hooks, ', '))));
+
+  // run through only select hook_search() as defined in /admin/settings/search_service
+  foreach ($search_hooks as $hook) {
+    if (! empty($hook)) {
+      $search_results = module_invoke($hook, 'search', 'search', $keys);
+      if (! empty($search_results) ) {
+        $results = array_merge($results, $search_results);
+      }
+    }
+  }
+
+  watchdog('search_service', t('search.content returned !count results for !keys using hooks !hooks', array('!count' => count($results),'!keys' => $keys, '!hooks' => implode($search_hooks, ', '))));
+
+  if ($results and is_array($results) and count($results)) {
+    // if simple results requested, remove extra data
+    if ($simple) {
+      $num = count($results);
+      for ($i = 0; $i<$num; $i++) {
+        $keys = array_keys($results[$i]);
+        foreach ($keys as $key) {
+          if (!in_array($key, $stdkeys)) {
+            unset($results[$i][$key]);
+          }
+        }
+      }
+    }
+    return $results;
+  }
+  return services_error(t('Search returned no results.'));
+}
+
+/**
  * Callback for search.users service.
  */
 function search_service_users($keys) {
Index: services/search_service/search_service.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/services/services/search_service/Attic/search_service.module,v
retrieving revision 1.1.4.16
diff -u -p -r1.1.4.16 search_service.module
--- services/search_service/search_service.module	12 Jan 2009 06:59:00 -0000	1.1.4.16
+++ services/search_service/search_service.module	13 Feb 2009 18:22:52 -0000
@@ -19,9 +19,40 @@ function search_service_help($path, $arg
 }
 
 /**
+ * Implementation of hook_perm().
+ */
+function search_service_perm() {
+  $perms = array('administer search service');
+
+  return $perms;
+}
+
+/**
+ * Implementation of hook_menu().
+ */
+function search_service_menu() {
+  $items = array();
+  $items['admin/settings/search_service'] = array(
+    'title'            => t('Search Service'),
+    'description'      => t('Configure Search service.'),
+    'page callback'    => 'drupal_get_form',
+    'page arguments'   => array('search_service_admin'),
+    'file'             => 'search_service_admin.inc',
+    'access arguments' => array('administer search service'),
+  );
+
+  return $items;
+}
+
+
+/**
  * Implementation of hook_service().
  */
 function search_service_service() {
+  global $conf;
+  if (!isset($conf['search_service_options'])) {
+    drupal_set_message(t('Please configure <a href="@settings">search_service settings</a> to choose search methods to return with this method.', array('@settings' => url('admin/settings/search_service'))), 'error');
+  }
   return array(
     array(
       '#method'           => 'search.nodes',
@@ -49,7 +80,31 @@ function search_service_service() {
         ),
       ),
       '#return'   => 'array',
-      '#help'     => t('Searches nodes according to keys via hook_search.'),
+      '#help'     => t('Searches nodes according to keys via node_search.'),
+    ),
+    array(
+      '#method'           => 'search.content',
+      '#callback'         => 'search_service_content',
+      '#access arguments' => array('search content'),
+      '#file'             => array('file' => 'inc', 'module' => 'search_service'),
+      '#key'              => TRUE,
+      '#args'             => array(
+        array(
+          '#name'         => 'search_keys',
+          '#type'         => 'string',
+          '#size'         => '',
+          '#signed'       => '',
+          '#description'  => t('Search keys.'),
+        ),
+        array(
+          '#name'         => 'simple',
+          '#type'         => 'string',
+          '#optional'     => TRUE,
+          '#description'  => t('If set, returns only the main search fields (link, type, title, user, date, snippet) and no additional data.'),
+        ),
+      ),
+      '#return'   => 'array',
+      '#help'     => t('Uses hook_search() selected under /admin/settings/search_service.'),
     ),
     array(
       '#method'   => 'search.users',
Index: services/search_service/search_service_admin.inc
===================================================================
RCS file: services/search_service/search_service_admin.inc
diff -N services/search_service/search_service_admin.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ services/search_service/search_service_admin.inc	13 Feb 2009 18:22:52 -0000
@@ -0,0 +1,38 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Search Service settings
+ */
+
+/**
+ * Form to choose which search services
+ */
+function search_service_admin() {
+  drupal_set_message(t('Choose search hooks that return local results. Do not choose aggregated or distributed results, as this may cause recursion.'), 'warning');
+
+  // For each enabled module, look for hook_search
+  foreach (module_list() as $name) {
+    if (function_exists($name . '_search')) {
+      $options[$name] = $name;
+    }
+  }
+
+  // If search_service_options not initialized, then make sure that it is an array
+  $default_value = variable_get('search_service_options', 'apachesolr_search');
+  if (! is_array($default_value)) {
+    $default_value = array($default_value);
+  }
+  
+  // Display checkboxes of list of hook_search()
+  $form['search_service_options'] = array(
+    '#type'          => 'checkboxes',
+    '#title'         => t('Search content services, returns searches results using'),
+    '#options'       => $options,
+    '#default_value' => variable_get('search_service_options', 'apachesolr_search'),
+    '#default_value' => $default_value,
+  );
+
+  return system_settings_form($form);
+}
