Good day all,
I'm trying to make work the apache solr view module with an image field, for doing so I'm adding the cck image field to the apache solr index and trying to show it through a custom handler as the views default handler is not showing it when checking the views page. Is there any way to format the image using the image resizing module. I'm using drupal 7
Thank you.
I created a custom module with this code
function custom_visual_apachesolr_update_index(&$document, $node) {
// Index field_mont_imagen as a separate field
if($node->type == 'motura') {
if (count($node->field_mont_imagen)) {
foreach ($node->field_mont_imagen as $image_lang) {
foreach ($image_lang as $image) {
$document->setMultiValue('sm_field_mont_imagen', $image['filename']);
}
}
}
}
}
function custom_visual_apachesolr_query_prepare(DrupalSolrQueryInterface $query) {
$query->addParam('fl', 'sm_field_mont_imagen');
}
/*
hook_views_data_alter() exposes our new field and sort to views
*/
function custom_visual_views_data_alter(&$data) {
$data['apachesolr_node']['sm_field_mont_imagen'] = array(
'title' => t('Montura image'),
'help' => t('Image for montura cck.'),
'field' => array(
'string' => TRUE,
'handler' => 'custom_visual_handler_field_image',