Hi,
Can some body help me? Is the code below correct for a my module?
When i test the code I get wrong content on fields.
Thanks,
Massimo
function wart_apachesolr_cck_fields_alter(&$mappings) {
// $mappings = array();
$mappings['per-field']['field_url'] = array(
'index_type' => 'string',
'callback' => 'wart_solr_callback',
'facet' => FALSE,
);
$mappings['per-field']['field_favicon_url'] = array(
'index_type' => 'string',
'callback' => 'wart_solr_callback',
'facet' => FALSE,
);
$mappings['per-field']['field_combined_rank'] = array(
'index_type' => 'sfloat',
'callback' => 'wart_solr_callback',
'facet' => FALSE,
);
$mappings['per-field']['field_alexa_rank'] = array(
'index_type' => 'integer',
'callback' => 'wart_solr_callback',
'facet' => FALSE,
);
$mappings['per-field']['field_alexa_data_url'] = array(
'index_type' => 'text',
'callback' => 'wart_solr_callback',
'facet' => FALSE,
);
}
Comments
Comment #1
maxmic commentedComment #2
shaneonabike commentedThis is what I did for a project that I am currently working on. This integrates the integer CCK field (generally speaking the latest code integrates the string CCK and taxonomy out of the box).
After developing some code for a website that we were building that required the integration of CCK types that were of type integer I thought I would post the following code to help others out.
CCK fields alter (CCK strings deal with these types out of the box but not for integers tragically)
Next function renders the checklist block
Finally the display callback (which is pretty basic)
Comment #3
jpmckinney commentedThis blog post has a good explanation of the API: http://acquia.com/blog/understanding-apachesolr-cck-api