Apache Solr: get list of "More Like This" nodes programmatically I'm using apachesolr module and it's "More Like This" block. 

This block displays only titles of similar nodes as links to these nodes. I need to display rendered nodes with specific view mode. How can I do this programmatically?
Here is the solution that I came up with.

function mymodule_similar_nodes($node) {
  if (module_exists('apachesolr_search')) {
    $output = '';
    $env_id = 'solr'; // machine name of solr server
    $delta = 'mlt-002'; // "More Like This" block delta
    $block = apachesolr_search_mlt_block_load($delta);
    $solr = apachesolr_get_solr($env_id);
    $context['search_type'] = 'apachesolr_search_mlt';
    $context['block_id'] = $delta;
    $docs = apachesolr_search_mlt_suggestions($block, apachesolr_document_id($node-&gt;nid), $solr, $context);
    $view_mode = 'teaser'; // view mode, e.g. 'full', 'teaser'...
    foreach ($docs as $doc) {
      if ($doc-&gt;entity_type == 'node') {
        $similar_node = node_load($doc-&gt;entity_id);
        $similar_node = node_view($similar_node, $view_mode);
        $output .= drupal_render($similar_node);
      }
    }
    return $output;
  }
}