During search indexing, the node.module invokes node_view and node view api before indexing it for content (see node_update_index). This, however, doesn't happen on node_search, which assumes that the body exists to get a snippet from. This causes an empty snippet on flexinode nodes, or anything else that requires a node view api. This patch simply adds the same block from node_update_index to node_search.

CommentFileSizeAuthor
#1 _p_26458_nodesearch.patch996 bytesmorbus iff
_p_nodesearch.patch1010 bytesmorbus iff

Comments

morbus iff’s picture

Assigned: Unassigned » morbus iff
Status: Active » Needs review
StatusFileSize
new996 bytes

Updated for HEAD.

chx’s picture

The patch applies, does what is described and it is needed. +1

Bèr Kessels’s picture

Just a thought: node_view can be extremely dynamic. so the search index might get overrun with odd or even non-existing entries.

Also: potentially, a node_view can return entries based on the role/permission. parts of a body can be hidden away for certain users. This patch will break that behaviour too.

I beleive that the search system needs some renewed thought, to overcome such issues.

Steven’s picture

Status: Needs review » Fixed

ber: the search system fetches snippets from whatever the current user is seeing. No hidden data will be displayed.

I committed it because it is required for flexinode, but ideally we should have a function to retrieve the processed node body/teaser in one go. It would replace similar code in node_update_index() and node_view().

Oh and the patch was buggy. It did not remove a now-obsolete call to check_output() lower in node_search.

Anonymous’s picture

trigear@drupal.trigearproductions.com’s picture

Anonymous’s picture

Anonymous’s picture

Anonymous’s picture

Status: Fixed » Closed (fixed)