I'm trying to configure a search page from Apache Solr module, and add some custom fields to the items. Here is the code I'm using for this
Custom module:
function hook_apachesolr_query_alter($query) {
$query->addParam('fl', 'ts_field_up_short_description');}
Function in tamplate.php:
function tamplate_preprocess_search_result(&$variables) {
$variables['ts_field_up_short_description'] = $variables['result']['fields']['ts_field_up_short_description'];}
Display field in search-result.tpl.php:
<?php if ($ts_field_up_short_description) : ?>
<?php print $ts_field_up_short_description; ?>
<?php endif; ?>
I'v created 3 nodes with this field, but only one of them displays the short description field (if displaying the search results with views everything is fine). Please tell me am I missing something? Thanks