Mailing List Archive

Search fix: secondary search
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
Re: Search fix: secondary search [ In reply to ]
On Nov 29, 2004, at 10:53 AM, John Andrews wrote:
> The help for search says this regarding secondary search:
>
> Oddly, sometimes no context is shown.

What is "secondary search"?

> We (Christian Zankel) seem to have fixed this by applying the
> following diff to mediawiki-1.3.8/includes/SearchEngine.php:

Looks like this change recently done in 1.4:
http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/includes/
SpecialSearch.php?r1=1.6&r2=1.7

This changes the meaning of the contextlines setting from the number of
lines at the beginning of the page to check, to the total number of
matching lines to show. Is this correct?

-- brion vibber (brion @ pobox.com)
Re: Search fix: secondary search [ In reply to ]
> On Nov 29, 2004, at 10:53 AM, John Andrews wrote:
> > The help for search says this regarding secondary
> search:
> >
> > Oddly, sometimes no context is shown.
>
> What is "secondary search"?

From the MediaWiki handbook:
http://meta.wikimedia.org/wiki/Help%3ASearching

Secondary search

After finding the pages, these pages are searched
again to have the results show in red in the context
lines; this search uses a more relaxed criterion:
search terms occurring in the wikitext, even as part
of a word, are shown in red.

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:
>
> Looks like this change recently done in 1.4:
>
http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/includes/
>
> SpecialSearch.php?r1=1.6&r2=1.7

Great, so the fix has already been applied.

> This changes the meaning of the contextlines setting
> from the number of
> lines at the beginning of the page to check, to the
> total number of
> matching lines to show. Is this correct?

Correct.

Thanks,

JA

>
> -- brion vibber (brion @ pobox.com)
> -------------- next part --------------



__________________________________
Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty viruses.
http://promotions.yahoo.com/new_mail
Re: Search fix: secondary search [ In reply to ]
On Nov 30, 2004, at 9:55 PM, John Andrews wrote:
> http://meta.wikimedia.org/wiki/Help%3ASearching
>
> Secondary search
>
> After finding the pages, these pages are searched
> again to have the results show in red in the context
> lines; this search uses a more relaxed criterion:
> search terms occurring in the wikitext, even as part
> of a word, are shown in red.

Who on earth invented that term? That's just the highlighting of search
results.

-- brion vibber (brion @ pobox.com)