Topic on Extension talk:Translate

Error using ElasticSearch in 1.27

4
Summary by Nikerabbit

ElasticSearch backend is not working on MediaWiki 1.27 and MLEB. Recommending to upgrade MediaWiki to use ElasticSearch backend.

Lsilverman (talkcontribs)

I'm running MW 1.27 with CirrusSearch+Elastica, which requires ElasticSearch 1.X. Cirrus and Elastica are pinned to the REL1_27 branches.

My wiki emailed me the following error upon attempting to translate my first page:

PHP Fatal error:  Call to undefined method Elastica\Query\BoolQuery::addFilter() in /var/www/devmediawiki-1.27/w/extensions/Translate/ttmserver/ElasticSearchTTMServer.php on line 282

LocalSettings.php portion looks like this:

$wgTranslateTranslationServices['TTMServer'] = array(
        'type' => 'ttmserver',
        'class' => 'ElasticSearchTTMServer',
        'cutoff' => 0.75,
        /*
         * See http://elastica.io/getting-started/installation.html
         * See https://github.com/ruflin/Elastica/blob/master/lib/Elastica/Client.php
        'config' => This will be passed to \Elastica\Client
         */
);
Lsilverman (talkcontribs)

Tracing the problem further, I see that REL1_27 of Elastica includes via composer ruflin/elastica 2.3.1.

elastica 2.3.1's version of Elastica/Query/BoolQuery.php does not contain the function addFilter().

Nikerabbit (talkcontribs)

Unfortunately this incompatibility has not been caught in our testing. Given 1.29 is soon going to be released, which means we are going to drop support for 1.27 from MLEB and Translate, I would encourage you to start planning for an upgrade and use the database backend for translation memory for the time being.

Lsilverman (talkcontribs)

We use Active Directory and LDAP. The LDAP auth plugins have not been updated in some time, and as a result we are stuck on 1.27.