? SolrPhpClient
Index: apachesolr.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/apachesolr/apachesolr.module,v
retrieving revision 1.1.2.12.2.155.2.92
diff -u -p -r1.1.2.12.2.155.2.92 apachesolr.module
--- apachesolr.module	27 Apr 2010 15:48:17 -0000	1.1.2.12.2.155.2.92
+++ apachesolr.module	27 Apr 2010 16:42:55 -0000
@@ -1672,7 +1672,7 @@ function apachesolr_field_name_map($fiel
 function apachesolr_cck_fields() {
   static $fields;
 
-  if (is_null($fields)) {
+  if (!isset($fields)) {
     $fields = array();
     // If CCK isn't enabled, do nothing.
     if (module_exists('content')) {
@@ -1725,10 +1725,12 @@ function apachesolr_cck_fields() {
       );
       // Allow other modules to add or alter mappings.
       drupal_alter('apachesolr_cck_fields', $mappings);
-      $result = db_query("SELECT i.field_name, f.multiple, f.type AS field_type, i.widget_type, i.label, i.type_name AS content_type FROM {content_node_field_instance} i INNER JOIN {content_node_field} f ON i.field_name = f.field_name;");
+      $result = db_query("SELECT i.field_name, f.multiple, f.type AS field_type, i.widget_type, i.label, i.type_name AS content_type, i.display_settings FROM {content_node_field_instance} i INNER JOIN {content_node_field} f ON i.field_name = f.field_name;");
       while ($row = db_fetch_object($result)) {
-        // Only deal with fields that have option widgets (facets don't make sense otherwise), or fields that have specific mappings.
-        if ((isset($mappings[$row->field_type][$row->widget_type]) ||  isset($mappings['per-field'][$row->field_name]))) {
+        $row->display_settings = unserialize($row->display_settings);
+        // Only deal with fields that have index mappings and that have not been
+        // marked for exclusion.
+        if ((isset($mappings[$row->field_type][$row->widget_type]) || isset($mappings['per-field'][$row->field_name])) && !$row->display_settings[NODE_BUILD_SEARCH_INDEX]['exclude']) {
           if (isset($mappings['per-field'][$row->field_name])) {
             $field = $mappings['per-field'][$row->field_name];
             $fields[$row->field_name] = $field;
