Index: apachesolr.index.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/apachesolr/Attic/apachesolr.index.inc,v
retrieving revision 1.1.2.1
diff -u -p -r1.1.2.1 apachesolr.index.inc
--- apachesolr.index.inc	16 Apr 2009 13:33:16 -0000	1.1.2.1
+++ apachesolr.index.inc	28 Apr 2009 18:24:49 -0000
@@ -115,7 +115,7 @@ function apachesolr_node_to_document($ni
         // Got a CCK field. See if it is to be indexed.
         $function = $cck_info['callback'];
         if ($cck_info['callback'] && function_exists($function)) {
-          $field = call_user_func_array($function, array($node, $key));
+          $field = $function($node, $key);
         }
         else {
           $field = $node->$key;
Index: apachesolr.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/apachesolr/apachesolr.module,v
retrieving revision 1.1.2.12.2.133
diff -u -p -r1.1.2.12.2.133 apachesolr.module
--- apachesolr.module	24 Apr 2009 18:03:24 -0000	1.1.2.12.2.133
+++ apachesolr.module	28 Apr 2009 18:24:49 -0000
@@ -1024,15 +1024,29 @@ function apachesolr_cck_fields() {
     $fields = array();
     // If CCK isn't enabled, do nothing.
     if (module_exists('content')) {
-      // A single default mapping for text fields.
-      $mappings['text'] = array('callback' => '', 'index_type' => 'string', 'widget_types' => array('optionwidgets_select' => 1, 'optionwidgets_buttons' => 1));
-      $mappings = module_invoke_all('apachesolr_cck_field_mappings') + $mappings;
+      // A single default mapping for all text fields.
+      $mappings['text'] = array(
+        'optionwidgets_select' => array('callback' => '', 'index_type' => 'string'),
+        'optionwidgets_buttons' => array('callback' => '', 'index_type' => 'string')
+      );
+      // A field-specific mapping would look like:
+      // $mappings['per-field']['field_model_name'] = array('callback' => '', 'index_type' => 'string');
+      // or
+      // $mappings['per-field']['field_model_price'] = array('callback' => '', 'index_type' => 'float');
+      // 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 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 options widgets (facets don't make sense otherwise), or fields that have specific mappings.
-        if (isset($mappings[$row->field_type]) && !empty($mappings[$row->field_type]['widget_types'][$row->widget_type])) {
-          $row->index_type = $mappings[$row->field_type]['index_type'];
-          $row->callback = $mappings[$row->field_type]['callback'];
+        // 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($fields[$row->field_name])) || isset($mappings['per-field'][$row->field_name])) {
+          if (isset($mappings['per-field'][$row->field_name])) {
+            $row->index_type = $mappings['per-field'][$row->field_name]['index_type'];
+            $row->callback = $mappings['per-field'][$row->field_name]['callback'];
+          }
+          else {
+            $row->index_type = $mappings[$row->field_type][$row->widget_type]['index_type'];
+            $row->callback = $mappings[$row->field_type][$row->widget_type]['callback'];
+          }
           $row->multiple = (bool) $row->multiple;
           $row->name = 'cck_' . $row->field_name;
           $fields[$row->field_name] = (array) $row;
Index: README.txt
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/apachesolr/README.txt,v
retrieving revision 1.1.2.1.2.15
diff -u -p -r1.1.2.1.2.15 README.txt
--- README.txt	3 Apr 2009 15:01:11 -0000	1.1.2.1.2.15
+++ README.txt	28 Apr 2009 18:24:49 -0000
@@ -121,7 +121,28 @@ hook_apachesolr_modify_query(&$query, &$
           $query->add_field("uid", 1);         
         }        
     
-hook_apachesolr_cck_field_mappings
+hook_apachesolr_cck_fields_alter(&$mappings)
+
+  Add or alter index mappings for CCK types.  The default mappings array handles just 
+  text fields with option widgets:
+
+    $mappings['text'] = array(
+      'optionwidgets_select' => array('callback' => '', 'index_type' => 'string'),
+      'optionwidgets_buttons' => array('callback' => '', 'index_type' => 'string')
+    );
+
+  In your _alter hook implementation you can add additional field types such as:
+
+    $mappings['number_integer']['number'] = array('callback' => '', 'index_type' => 'integer');
+
+  You can allso add a mapping for a specific field.  This will take precedence over any
+  mapping for a general field type. A field-specific mapping would look like:
+
+    $mappings['per-field']['field_model_name'] = array('callback' => '', 'index_type' => 'string');
+
+  or
+
+    $mappings['per-field']['field_model_price'] = array('callback' => '', 'index_type' => 'float');
 
 hook_apachesolr_node_exclude($node)
 
