Problem/Motivation

I have frequently wanted to see a node "through Solr's eyes", in order to troubleshoot unexpected search results.

Proposed resolution

Extending the devel tab on node pages seems like a natural way to achieve this. This tab can help a developer quickly answer questions like:

  • What text is included in content?
  • What does tags_h4_h5_h6 contain?
  • Which text fields are included in the index?
  • What's solr's name for my date field?

Remaining tasks

Patch needs review

User interface changes

An extra tab is added to the devel button on node pages.

API changes

N/A

Comments

pwolanin’s picture

Status: Needs review » Needs work

good idea, though this doesn't seem to handle correctly the case of multiple documents created from one node?

grendzy’s picture

I'm not sure how to test it, but I think each document would show as a separate krumo tree on the same page since they are appended in the for loop. What would be the best way to display multiple documents?

There's also the question of non-node entities. There's probably no way to offer buttons for all entities, though I did just notice there's a user/N/devel.

pwolanin’s picture

oh, I see:

$output .= kdevel_print_object($debug_data);

But the page callback is returning a string instead of a render array?

pwolanin’s picture

updated patch?

nick_vh’s picture

Status: Needs work » Reviewed & tested by the community
StatusFileSize
new74 KB

I tried with multiple documents and it looks fine. marking as RTBC. I really dig this one!

nick_vh’s picture

Version: 7.x-1.x-dev » 6.x-3.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

committed to 7.x-1.x and credited you for this! thanks a dozen!

killua99’s picture

Looking great! this patch ... I'm gonna try this backporting because I'm right know under i+d with solr, so this is great for me also.

killua99’s picture

Status: Patch (to be ported) » Needs review
StatusFileSize
new1.71 KB

I test it in my site, and I don't see any "weird" data or behavior. The back-porting wasn't hard at all.

I just notice one think in apachesolr.index.inc

# @line 113
function apachesolr_index_entity_to_documents($item, $env_id) {

 // this variables have some use? I did not see any kind of use.
  $id = $item->entity_id;
  $bundle = $item->bundle;

nick_vh’s picture

Status: Needs review » Needs work
+++ b/apachesolr.admin.incundefined
@@ -1138,3 +1138,26 @@ function apachesolr_index_config_form_submit($form, &$form_state) {
+  $item              = new stdClass();
+  $item->entity_type = 'node';
+  $item->entity_id   = $node->nid;

bad coding standards, please remove obsolete spaces :-)

Thanks

killua99’s picture

Status: Needs work » Needs review
StatusFileSize
new3.41 KB

Ok just learning ...

killua99’s picture

StatusFileSize
new3.39 KB
nick_vh’s picture

Status: Needs review » Needs work

looks like you have the same patch twice in one file?

killua99’s picture

Status: Needs work » Needs review
StatusFileSize
new1.7 KB

Kinda weird yes ... it's look like, But my local file is just one patch ... o.O not twice the same code :/ try it again ...

nick_vh’s picture

Status: Needs review » Fixed

committed. Thanks!

nick_vh’s picture

Status: Fixed » Closed (fixed)