Page MenuHomePhabricator

CirrusSearch uses Elastica's Match class
Closed, ResolvedPublic

Related Objects

StatusSubtypeAssignedTask
ResolvedReedy
ResolvedEBernhardson
ResolvedGehel
ResolvedEBernhardson
ResolvedEBernhardson
Resolveddcausse
Resolveddcausse
Resolveddcausse
Resolveddcausse
Resolveddcausse
OpenNone
ResolvedEBernhardson
DuplicateNone
ResolvedEBernhardson
Resolved EJoseph
ResolvedEBernhardson
DuplicateNone
ResolvedGehel
Resolved EJoseph
Resolvedbking
Resolvedbking
ResolvedRKemper
ResolvedRKemper
ResolvedRKemper
ResolvedRKemper
ResolvedGehel
Resolvedbking
Resolvedbking
Resolvedbking
Resolvedbking
Resolvedbking
Resolvedbking
Resolvedbking
ResolvedEBernhardson
ResolvedEBernhardson
ResolvedTJones
Resolved Zbyszko
DeclinedNone
DeclinedNone
ResolvedTJones
ResolvedEBernhardson
DeclinedNone
Resolvedbd808
DeclinedNone
ResolvedEBernhardson
DeclinedNone
Resolveddcausse
ResolvedEBernhardson
ResolvedEBernhardson
ResolvedEBernhardson
Resolvedbking
ResolvedGehel
ResolvedGehel
ResolvedRKemper
ResolvedBUG REPORTEBernhardson
ResolvedEBernhardson
ResolvedRKemper
ResolvedEBernhardson
Resolvedkostajh
ResolvedReedy

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Do we want to ask for a backport to 6.x?

I asked at https://github.com/ruflin/Elastica/pull/1799#issuecomment-734534950

This is potentially blocked on T263142: [EPIC] Upgrade Elasticsearch to version 7.10 (which looks to be making progress) and depending on when the upgrades happen, a bump to using at least 7.1.0 of the Elastica library. Not marking as a blocker just yet (it's not one if it gets backported; if it doesn't get backported, it probably is)

Reedy changed the task status from Open to Stalled.Feb 7 2021, 12:30 AM
Reedy changed the task status from Stalled to Open.Mar 6 2021, 6:37 PM

Change 713632 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/extensions/CirrusSearch@master] Replace Elastica\\Query\\Match with Elastica\\Query\\MatchQuery

https://gerrit.wikimedia.org/r/713632

Change 713632 merged by jenkins-bot:

[mediawiki/extensions/CirrusSearch@master] Replace Elastica\\Query\\Match with Elastica\\Query\\MatchQuery

https://gerrit.wikimedia.org/r/713632

Reedy claimed this task.

Change 713848 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/extensions/CirrusSearch@REL1_36] Replace Elastica\\Query\\Match with Elastica\\Query\\MatchQuery

https://gerrit.wikimedia.org/r/713848

Change 713849 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/extensions/CirrusSearch@REL1_35] Replace Elastica\\Query\\Match with Elastica\\Query\\MatchQuery

https://gerrit.wikimedia.org/r/713849

Change 713848 merged by jenkins-bot:

[mediawiki/extensions/CirrusSearch@REL1_36] Replace Elastica\\Query\\Match with Elastica\\Query\\MatchQuery

https://gerrit.wikimedia.org/r/713848

Change 713849 merged by jenkins-bot:

[mediawiki/extensions/CirrusSearch@REL1_35] Replace Elastica\\Query\\Match with Elastica\\Query\\MatchQuery

https://gerrit.wikimedia.org/r/713849

Hello,

After switching to mediawikia 1.37wmf23 with php 8.010 it seems that elastic is now working correctly.

Nevertheless, an error persists when searching with a ":" character.

[99a80ba4319b973cca1c54a7] /index.php?search=%C3%A9v%C3%A9nement+%3A+c&title=Sp%C3%A9cial%3ARecherche&go=Lire&ns0=1 ParseError: syntax error, unexpected token "match"

Backtrace:

from /var/www/vhosts/fallout-wiki.com/httpdocs/extensions/Elastica/vendor/ruflin/elastica/lib/Elastica/Query/MatchQuery.php(10)

#0 /var/www/vhosts/fallout-wiki.com/httpdocs/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile()

#1 /var/www/vhosts/fallout-wiki.com/httpdocs/extensions/CirrusSearch/includes/MetaStore/MetaNamespaceStore.php(95): Composer\Autoload\ClassLoader->loadClass()

#2 /var/www/vhosts/fallout-wiki.com/httpdocs/extensions/CirrusSearch/includes/MetaStore/MetaNamespaceStore.php(79): CirrusSearch\MetaStore\MetaNamespaceStore->queryFilter()

#3 /var/www/vhosts/fallout-wiki.com/httpdocs/extensions/CirrusSearch/includes/Searcher.php(469): CirrusSearch\MetaStore\MetaNamespaceStore->find()

#4 /var/www/vhosts/fallout-wiki.com/httpdocs/extensions/CirrusSearch/includes/Util.php(125): CirrusSearch\Searcher->CirrusSearch\{closure}()

#5 /var/www/vhosts/fallout-wiki.com/httpdocs/includes/poolcounter/PoolCounterWorkViaCallback.php(74): CirrusSearch\Util::CirrusSearch\{closure}()

#6 /var/www/vhosts/fallout-wiki.com/httpdocs/includes/poolcounter/PoolCounterWork.php(162): PoolCounterWorkViaCallback->doWork()

#7 /var/www/vhosts/fallout-wiki.com/httpdocs/extensions/CirrusSearch/includes/Util.php(183): PoolCounterWork->execute()

#8 /var/www/vhosts/fallout-wiki.com/httpdocs/extensions/CirrusSearch/includes/Searcher.php(475): CirrusSearch\Util::doPoolCounterWork()

#9 /var/www/vhosts/fallout-wiki.com/httpdocs/extensions/CirrusSearch/includes/Searcher.php(701): CirrusSearch\Searcher->findNamespace()

#10 /var/www/vhosts/fallout-wiki.com/httpdocs/extensions/CirrusSearch/includes/Hooks.php(531): CirrusSearch\Searcher->updateNamespacesFromQuery()

#11 /var/www/vhosts/fallout-wiki.com/httpdocs/includes/HookContainer/HookContainer.php(338): CirrusSearch\Hooks::onSearchGetNearMatch()

#12 /var/www/vhosts/fallout-wiki.com/httpdocs/includes/HookContainer/HookContainer.php(137): MediaWiki\HookContainer\HookContainer->callLegacyHook()

#13 /var/www/vhosts/fallout-wiki.com/httpdocs/includes/HookContainer/HookRunner.php(3192): MediaWiki\HookContainer\HookContainer->run()

#14 /var/www/vhosts/fallout-wiki.com/httpdocs/includes/search/SearchNearMatcher.php(168): MediaWiki\HookContainer\HookRunner->onSearchGetNearMatch()

#15 /var/www/vhosts/fallout-wiki.com/httpdocs/includes/search/SearchNearMatcher.php(70): SearchNearMatcher->getNearMatchInternal()

#16 /var/www/vhosts/fallout-wiki.com/httpdocs/includes/specials/SpecialSearch.php(341): SearchNearMatcher->getNearMatch()

#17 /var/www/vhosts/fallout-wiki.com/httpdocs/includes/specials/SpecialSearch.php(200): SpecialSearch->goResult()

#18 /var/www/vhosts/fallout-wiki.com/httpdocs/includes/specialpage/SpecialPage.php(647): SpecialSearch->execute()

#19 /var/www/vhosts/fallout-wiki.com/httpdocs/includes/specialpage/SpecialPageFactory.php(1366): SpecialPage->run()

#20 /var/www/vhosts/fallout-wiki.com/httpdocs/includes/MediaWiki.php(314): MediaWiki\SpecialPage\SpecialPageFactory->executePath()

#21 /var/www/vhosts/fallout-wiki.com/httpdocs/includes/MediaWiki.php(925): MediaWiki->performRequest()

#22 /var/www/vhosts/fallout-wiki.com/httpdocs/includes/MediaWiki.php(559): MediaWiki->main()

#23 /var/www/vhosts/fallout-wiki.com/httpdocs/index.php(53): MediaWiki->run()

#24 /var/www/vhosts/fallout-wiki.com/httpdocs/index.php(46): wfIndexMain()

#25 {main}

This is technically an upstream issue, but we also don't claim PHP 8.0 support either.

The MatchQuery class was allowed for "earlier" migration of code and not need hacks to have code working needing Match in one version of ruflin/elastica and MatchQuery in others.

If you look at https://github.com/ruflin/Elastica/blob/6.1.5/composer.json#L15 it does explicitly say "php": "^7.0", which means it doesn't support PHP 8.

This is technically an upstream issue, but we also don't claim PHP 8.0 support either.

The MatchQuery class was allowed for "earlier" migration of code and not need hacks to have code working needing Match in one version of ruflin/elastica and MatchQuery in others.

If you look at https://github.com/ruflin/Elastica/blob/6.1.5/composer.json#L15 it does explicitly say "php": "^7.0", which means it doesn't support PHP 8.

Hello,

We use the master branch of eslastica which is well noted as compatible with php 8:

"php": "^7.2 || ^8.0",

https://github.com/ruflin/Elastica/blob/master/composer.json

Using other versions of libraries than we have set in composer.json isn't supported by us.

Also, based on your stack trace you don't...

Hello,

After switching to mediawikia 1.37wmf23 with php 8.010 it seems that elastic is now working correctly.

Nevertheless, an error persists when searching with a ":" character.

[99a80ba4319b973cca1c54a7] /index.php?search=%C3%A9v%C3%A9nement+%3A+c&title=Sp%C3%A9cial%3ARecherche&go=Lire&ns0=1 ParseError: syntax error, unexpected token "match"

Backtrace:

from /var/www/vhosts/fallout-wiki.com/httpdocs/extensions/Elastica/vendor/ruflin/elastica/lib/Elastica/Query/MatchQuery.php(10)

On the 6.1.5 tag, https://github.com/ruflin/Elastica/blob/6.1.5/lib/Elastica/Query/MatchQuery.php#L10 and the line contains match and the path to it matches - lib/Elastica/Query/MatchQuery.php

On master, the path to MatchQuery is completely different and doesn't match your stack trace - https://github.com/ruflin/Elastica/blob/master/src/Query/MatchQuery.php - src/Query/MatchQuery.php

Change 1000928 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/vendor@master] composer: Disable linting the Match.php file that breaks PHP 8.0

https://gerrit.wikimedia.org/r/1000928

Change 1000928 merged by jenkins-bot:

[mediawiki/vendor@master] composer: Disable linting the Match.php file that breaks PHP 8.0

https://gerrit.wikimedia.org/r/1000928