See http://drupal.org/node/493270#comment-3323448 - reported by gpk

SBP allows preprocessors to find matches for highlighting them in excerpts. gpk says (using Porter Stemmer with SBP):

A node has content "qqQqqeateat qqQqqeating qqQqqeat hello world"

When I search for "qqqqqeat" I get the following snippet:

qqQqqeateat qqQqqeating qqQqqeat hello world

What seems to be happening is that the exact match is taking priority, and then, provided our excerpt length is under 256 characters, and having tried any other keys, the code only looks for any *subsequent* matches against that particular key. If the node has the words in a different order "qqQqqeat qqQqqeateat qqQqqeating hello world" then I do get qqQqqeating highlighted as well i.e. the snippet is qqQqqeat qqQqqeateat qqQqqeating hello world, because having found the exact match (the "bare keyword") there is a *subsequent* valid stem match.

Comments

gpk’s picture

Great, it occurs to me I can probably use SBP instead of my custom module that overwrites (using code from SBP) the snippet generated by search.module... I mistakenly got the idea somehow that SBP indexed the whole page as rendered by the theme and not just the main content part. Does a plain vanilla SBP install basically mimic search module for nodes? I note that SBP "indexes the "content" pane of each page as rendered by your theme" .. I'm not clear what this means in practice or whether I will actually see any difference.. apols, this is a bit off-topic! but might make it easier for me to test!

jhodgdon’s picture

"as rendered by your theme" means that the content pane is run through your theme files, as opposed to the default rendering that drupal core uses.

So for instance if you have a custom node.tpl.php in your theme (or a custom one for a particular content type), you will get that file's output as opposed to node_view()'s output.

If you are using a default node.tpl.php you will likely not see any difference.

jhodgdon’s picture

Status: Active » Fixed

I just committed a fix for this (including a test) to both the D6 and D7 development branches of Search by Page.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.