Closed (fixed)
Project:
Apache Solr Search
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 Nov 2009 at 19:07 UTC
Updated:
22 Apr 2010 at 17:20 UTC
I had great difficulty getting an indexing callback for a cck field to work.
My apachesolr_cck_fields_alter implementation and indexing callback looked like this:
/**
* Implementation of hook_apachesolr_cck_fields_alter
*/
function custom_search_apachesolr_cck_fields_alter(&$mappings) {
$mappings['per-field']['field_location'] = array(
'indexing callback' => custom_search_index_location',
'index_type' => 'string',
);
return $mappings;
}
function custom_search_index_location($node, $key) {
$fields = array();
foreach ($node->$key as $field) {
$fields[] = array('value' => check_plain($field['city'] . ', ' . $field['province']));
}
return $fields;
}
Debugging lead me to several problems in apachesolr_node_to_document():
The attached patch attempts to fix these problems.
| Comment | File | Size | Author |
|---|---|---|---|
| apachesolr_cck_fields.patch | 1.92 KB | jtsnow |
Comments
Comment #1
robertdouglass commentedI'm working on a larger patch for cck dates that shuffles things around quite a bit and also fixes this particular problem. Thanks for reporting, and stay tuned.
Comment #2
drewish commentedfixing the status.
is #558160: date facet for cck field related to this?
Comment #3
robertdouglass commentedIs this still an issue with latest 6.x-2.x?
Comment #4
mcarbone commentedI'm still having the problem of $cck_info['indexing_callback'] not having a value for a text field with the 'Select list' widget, which is leading to that field not being indexed. Not sure if it's related. More info here: http://drupal.org/node/558160#comment-2734454
Comment #5
robertdouglass commentedThis should now be fixed for 6.2 in the .dev branch.
Comment #6
robertdouglass commentedMarking as fixed unless someone has a contrary experience.