Page MenuHomePhabricator

Api search returns empty page with MWSearch extension when srsearch=title
Closed, ResolvedPublic


Author: Bryan.TongMinh

Api search returns empty page with MWSearch extension. See

Version: 1.13.x
Severity: major



Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:02 PM
bzimport set Reference to bz13482.
bzimport added a subscriber: Unknown Object (MLST).

It appears the bug only applies to searches with the parameter srsearch=title which is the default for this parameter.

Not working:

Bumped severity to major.

Bryan.TongMinh wrote:

That clarifies a lot. See this code in the MWSearch extension:

// this stuff's a little broken atm
global $wgLuceneDisableTitleMatches;
if( $wgLuceneDisableTitleMatches ) {
    return null;
} else {
    return LuceneSearchSet::newFromQuery( 'titlematch',
        $term, $this->namespaces, $this->limit, $this->offset );

Apparently a search can return null sometimes. The question is what to do when null is returned. Should we raise an error or silently fail and return an empty list?

Bryan.TongMinh wrote:

Fixed in r32349. Will raise a search-text-disabled or search-title-disabled when either search type is disabled.

Note that the split between title and text searching will probably go away entirely soon.