You are here

function apachesolr_commentsearch_apachesolr_search_result_alter in Apache Solr Search 6.2

File

contrib/apachesolr_commentsearch/apachesolr_commentsearch.module, line 92

Code

function apachesolr_commentsearch_apachesolr_search_result_alter(&$doc, &$extra) {
  if ($doc->type == 'comment') {
    $nid = $doc->nid;
    $extra['cid'] = $doc->is_cid;
    $node = node_load($nid);
    $query = apachesolr_commentsearch_page_count(comment_num_all($nid), $node, $doc->is_cid, $doc->ss_thread);
    $doc->path = url($doc->path, array(
      'absolute' => TRUE,
      'fragment' => "comment-{$doc->is_cid}",
      'query' => $query,
    ));
  }
}