Add custom fields to the Apache Solr search results 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-&gt;addParam('fl', 'ts_field_up_short_description');}


Function in tamplate.php:

function tamplate_preprocess_search_result(&amp;$variables) {
$variables['ts_field_up_short_description'] = $variables['result']['fields']['ts_field_up_short_description'];}


Display field in search-result.tpl.php:

&lt;?php if ($ts_field_up_short_description) : ?&gt;
     &lt;?php print $ts_field_up_short_description; ?&gt;
&lt;?php endif; ?&gt;


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
I have forgotten to add the content type filters, everything is correct now. Another (better) way is to modify the snippet in module (like here) instead of the search results template.