You are here

function apachesolr_devel in Apache Solr Search 7

Same name and namespace in other branches
  1. 8 apachesolr.admin.inc \apachesolr_devel()
  2. 6.3 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 1367
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;
}