You are here

function apachesolr_devel in Apache Solr Search 8

Same name and namespace in other branches
  1. 6.3 apachesolr.admin.inc \apachesolr_devel()
  2. 7 apachesolr.admin.inc \apachesolr_devel()

Page callback for node/%node/devel/apachesolr.

Parameters

object $node:

Return value

string debugging information

1 string reference to 'apachesolr_devel'
apachesolr_menu in ./apachesolr.module
Implements hook_menu().

File

./apachesolr.admin.inc, line 1345
Administrative pages for the Apache Solr framework.

Code

function apachesolr_devel($node) {
  module_load_include('inc', 'apachesolr', 'apachesolr.index');
  $item = new stdClass();
  $item->entity_type = 'node';
  $item->entity_id = $node->nid;
  $output = '';
  foreach (apachesolr_load_all_environments() as $env_id => $environment) {
    $documents = apachesolr_index_entity_to_documents($item, $env_id);
    $output .= '<h1>' . t('Environment %name (%env_id)', array(
      '%name' => $environment['name'],
      '%env_id' => $env_id,
    )) . '</h1>';
    foreach ($documents as $document) {
      $debug_data = array();
      foreach ($document as $key => $value) {
        $debug_data[$key] = $value;
      }
      $output .= kdevel_print_object($debug_data);
    }
  }
  return $output;
}