Semanticmediawiki: CirrusSearch can no longer be run parallel to Semantic MediaWiki

Created on 22 Aug 2020  路  7Comments  路  Source: SemanticMediaWiki/SemanticMediaWiki

Setup and configuration

  • MediaWiki | 1.35.0-rc.2 (0f1a2a2)18:43, 21 August 2020
  • PHP | 7.2.24-0ubuntu0.18.04.6 (apache2handler)
  • MariaDB | 10.1.44-MariaDB-0ubuntu0.18.04.1
  • Elasticsearch | 6.5.4
  • Semantic MediaWiki | 3.2.0-alpha (1c1c4a2) 19:23, 17 August 2020
  • CirrusSearch | 6.5.4 (f835850) 13:28, 13 July 2020
  • Elastica | 6.1.1 (3e3b76f) 13:44, 13 July 2020

Issue

When trying to access "Special:Search" ([5880e7e48ab0ed2c7ef340b6] /w/index.php?search=Extra%3A&title=Sp%C3%A9cial%3ARecherche&go=Go) the following issue appears, i.e. SMW no longer runs parallel with CirrusSearch and causes the latter to fail gracefully meaning that it cannot longer be used at all without pushing the wiki into it's knees.

Error from line 477 of /../w/LocalSettings.php: Class 'CirrusSearch' not found

Configuration

### Search settings
$wgSearchType = 'SMWSearch';
$smwgFallbackSearchType = function() {
     return new \CirrusSearch();
     };

Stack trace

Produces a stack trace and/or outputs:

#0 /../w/extensions/SemanticMediaWiki/src/MediaWiki/Search/SearchEngineFactory.php(49): {closure}(Wikimedia\Rdbms\LoadBalancer)
#1 /../w/extensions/SemanticMediaWiki/src/MediaWiki/Search/ExtendedSearchEngine.php(43): SMW\MediaWiki\Search\SearchEngineFactory->newFallbackSearchEngine(Wikimedia\Rdbms\LoadBalancer)
#2 /../w/vendor/wikimedia/object-factory/src/ObjectFactory.php(184): SMW\MediaWiki\Search\ExtendedSearchEngine->__construct()
#3 /../w/includes/search/SearchEngineFactory.php(63): Wikimedia\ObjectFactory::getObjectFromSpec(array, array)
#4 /../w/includes/MediaWikiServices.php(1137): SearchEngineFactory->create()
#5 /../w/includes/specials/SpecialSearch.php(780): MediaWiki\MediaWikiServices->newSearchEngine()
#6 /../w/includes/specials/SpecialSearch.php(227): SpecialSearch->getSearchEngine()
#7 /../w/includes/specials/SpecialSearch.php(135): SpecialSearch->load()
#8 /../w/includes/specialpage/SpecialPage.php(600): SpecialSearch->execute(NULL)
#9 /../w/includes/specialpage/SpecialPageFactory.php(635): SpecialPage->run(NULL)
#10 /../w/includes/MediaWiki.php(307): MediaWiki\SpecialPage\SpecialPageFactory->executePath(Title, RequestContext)
#11 /../w/includes/MediaWiki.php(940): MediaWiki->performRequest()
#12 /../w/includes/MediaWiki.php(543): MediaWiki->main()
#13 /../w/index.php(53): MediaWiki->run()
#14 /../w/index.php(46): wfIndexMain()
#15 {main}
documentation mediawiki question

Most helpful comment

I cut some corners in my reply. I think this should work:

use CirrusSearch\CirrusSearch; # usually placed on top of the file

$wgSearchType = 'SMWSearch';
$smwgFallbackSearchType = function() {
      return new CirrusSearch(); # No \ here
};

All 7 comments

I think this is a show stopper for the final release of SMW 3.2.0

The class is now in a namespace: https://gerrit.wikimedia.org/g/mediawiki/extensions/CirrusSearch/+/228e6036e01f52c29ac53f0876cd9ca736062631/includes/CirrusSearch.php#50

You need use CirrusSearch; in your LocalSettings.php (BC compatible) or use the fully qualified name (not BC compatible).

@Nikerabbit Thanks for your information. I am not a developer and cannot tranlate it into a working configuration. Currently I have:

$wgSearchType = 'SMWSearch';
$smwgFallbackSearchType = function() {
      return new \CirrusSearch();
      };

In the future I would do if I understand correctly:

$wgSearchType = 'SMWSearch';
use CirrusSearch;

Basically I do not know how to fill $smwgFallbackSearchType.

Ah using use CirrusSearch; creates pain, too. To cut it short. I have no idea what to do.

I cut some corners in my reply. I think this should work:

use CirrusSearch\CirrusSearch; # usually placed on top of the file

$wgSearchType = 'SMWSearch';
$smwgFallbackSearchType = function() {
      return new CirrusSearch(); # No \ here
};

I cut some corners in my reply. I think this should work:

Thanks a lot! Great! It does indeed. No worries here. However doing it without shortcuts in this case will help many others.

There are so many bad programmers around that I never bothered joining them. This came at the price that I cannot figure this out on my own. :(

Was this page helpful?
0 / 5 - 0 ratings