Page MenuHomePhabricator

search: craft a fake InitialiseSettings.php for lucene-search-2
Closed, DeclinedPublic

Description

lucene-search-2 parse the production InitialiseSettings.php file to extract several settings arrays such as $wgCanonicalServer. On beta, the settings are overridden by InitiaseSettings-labs.php which is unknown to lucene-search-2.

We could adapt the Java code base to recognize the -labs file, but it seems to be easier to write a tiny script that will read both files and craft a new one for lucene-search-2 consumption.


Version: unspecified
Severity: enhancement

Details

Reference
bz45786

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 1:23 AM
bzimport set Reference to bz45786.

In operations/debs/lucene-search-2 look for src/org/wikimedia/lsearch/util/PHPParser.java which has a list of accessor looking for some specific variables. Among them:

  • wgLanguageCode
  • wgCanonicalServer
  • wgMetaNamespace
  • wgMetaNamespaceTalk
  • wgNamespacesToBeSearchedDefault
  • wgNamespacesWithSubpages
  • wgExtraNamespaces
  • wgContentNamespaces

The one we care about is getServer() which is based on wgCanonicalServer.

Some progress with patchsets 14 and 15 of gerrit change 51677

I have made the puppet class to copy the InitialiseSettings-labs.php and have lsearch to load a configuration file named /a/search/conf/mw-beta-context.php

I have hacked it manually on the instance, that let us have lsearch query OAI update on beta labs. Will have to figure out how to generate that file automatically after the conf has been synchronized.

We agreed with Ram that supporting beta configuration files should not be done in lucene-search-2 since that will slow him down on other projects. I got a lame script handling the merge of the production and labs configuration files. Need to Puppetize it though.

There is a hack in place which is good enough for now. The lucene-search is going to be phased out in favor of CirrusSearch extension with a SOLR or ElasticSearch backend.