The help for search says this regarding secondary search:
Oddly, sometimes no context is shown.
We (Christian Zankel) seem to have fixed this by applying the
following diff to mediawiki-1.3.8/includes/SearchEngine.php:
402a403
--$contextlines;
408d408
< --$contextlines;
Resulting in code that looks like this:
foreach ( $lines as $line ) {
if ( 0 == $contextlines ) {
break;
}
++$lineno;
if ( ! preg_match( $pat1, $line, $m ) ) {
continue;
}
--$contextlines; # <<<<==== Moved past continue.
$pre = $wgLang->truncate( $m[1], -$contextchars,
"..." );
JA