Page MenuHomePhabricator

incategory filter is not working
Open, Needs TriagePublic

Description

When using query incategory:Category query:

Error from line 298 of [wiki_path]/extensions/SphinxSearch/SphinxMWSearch.php: Call to a member function selectField() on null

Backtrace:

#0 [wiki_path]/extensions/SphinxSearch/SphinxMWSearch.php(258): SphinxMWSearch->filterByCategory(array)
#1 [internal function]: SphinxMWSearch->replaceQueryPrefix(array)
#2 [wiki_path]/extensions/SphinxSearch/SphinxMWSearch.php(208): preg_replace_callback(string, array, string)
#3 [wiki_path]/includes/specials/SpecialSearch.php(290): SphinxMWSearch->replacePrefixes(string)
#4 [wiki_path]/includes/specials/SpecialSearch.php(237): SpecialSearch->showResults(string)
#5 [wiki_path]/includes/specials/SpecialSearch.php(152): SpecialSearch->goResult(string)
#6 [wiki_path]/includes/specialpage/SpecialPage.php(522): SpecialSearch->execute(NULL)
#7 [wiki_path]/includes/specialpage/SpecialPageFactory.php(576): SpecialPage->run(NULL)
#8 [wiki_path]/includes/MediaWiki.php(283): SpecialPageFactory::executePath(Title, RequestContext)
#9 [wiki_path]/includes/MediaWiki.php(858): MediaWiki->performRequest()
#10 [wiki_path]/includes/MediaWiki.php(519): MediaWiki->main()
#11 [wiki_path]/index.php(43): MediaWiki->run()
#12 {main}

Mediawiki on git master, plugin on git master.

Event Timeline

Having the same problem here.

MW 1.28
SphinxSearch Extension: 0.9.0 (from git repo).

Thanks!

I am not able to replicate this issue - tried both with current version of the extension and an older one. Thes two queries produce correctly different results:

Paul incategory:Religion

Paul incategory:Art

BTW, I did notice that incategory filter seems to be case-sensitive. Also, it only works if you do specific additional string, and not just the category. Perhpas the issue is only when there is nothing but the category name in the query (but I did not get any errors in that case either, selectField is called on $this->db which is setup in the parent class constructor.)