Page MenuHomePhabricator

PHP Notice: Undefined index: lexeme_language / lexical_category
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error

In line 231:

labels.normalized_message
[{reqId}] {exception_url}   PHP Notice: Undefined index: lexeme_language

In line 232:

labels.normalized_message
[{reqId}] {exception_url}   PHP Notice: Undefined index: lexeme_category
error.stack_trace
from /srv/mediawiki/php-1.43.0-wmf.6/extensions/WikibaseLexemeCirrusSearch/src/LexemeFulltextResult.php(231)
#0 /srv/mediawiki/php-1.43.0-wmf.6/extensions/WikibaseLexemeCirrusSearch/src/LexemeFulltextResult.php(231): MWExceptionHandler::handleError(integer, string, string, integer, array)
#1 /srv/mediawiki/php-1.43.0-wmf.6/extensions/CirrusSearch/includes/Search/MSearchResponses.php(88): Wikibase\Lexeme\Search\Elastic\LexemeFulltextResult->transformElasticsearchResult(Elastica\ResultSet)
#2 /srv/mediawiki/php-1.43.0-wmf.6/extensions/CirrusSearch/includes/Searcher.php(397): CirrusSearch\Search\MSearchResponses->transformAsResultSet(Wikibase\Lexeme\Search\Elastic\LexemeFulltextResult, string)
#3 /srv/mediawiki/php-1.43.0-wmf.6/extensions/CirrusSearch/includes/Searcher.php(218): CirrusSearch\Searcher->searchTextInternal(string)
#4 /srv/mediawiki/php-1.43.0-wmf.6/extensions/CirrusSearch/includes/CirrusSearch.php(305): CirrusSearch\Searcher->search(CirrusSearch\Search\SearchQuery)
#5 /srv/mediawiki/php-1.43.0-wmf.6/extensions/CirrusSearch/includes/CirrusSearch.php(278): CirrusSearch\CirrusSearch->searchTextReal(CirrusSearch\Search\SearchQuery)
#6 /srv/mediawiki/php-1.43.0-wmf.6/includes/search/SearchEngine.php(100): CirrusSearch\CirrusSearch->doSearchText(string)
#7 /srv/mediawiki/php-1.43.0-wmf.6/includes/search/SearchEngine.php(192): SearchEngine->{closure}()
#8 /srv/mediawiki/php-1.43.0-wmf.6/includes/search/SearchEngine.php(101): SearchEngine->maybePaginate(Closure)
#9 /srv/mediawiki/php-1.43.0-wmf.6/includes/specials/SpecialSearch.php(470): SearchEngine->searchText(string)
#10 /srv/mediawiki/php-1.43.0-wmf.6/includes/specials/SpecialSearch.php(246): MediaWiki\Specials\SpecialSearch->showResults(string)
#11 /srv/mediawiki/php-1.43.0-wmf.6/includes/specialpage/SpecialPage.php(719): MediaWiki\Specials\SpecialSearch->execute(NULL)
#12 /srv/mediawiki/php-1.43.0-wmf.6/includes/specialpage/SpecialPageFactory.php(1680): MediaWiki\SpecialPage\SpecialPage->run(NULL)
#13 /srv/mediawiki/php-1.43.0-wmf.6/includes/actions/ActionEntryPoint.php(502): MediaWiki\SpecialPage\SpecialPageFactory->executePath(string, MediaWiki\Context\RequestContext)
#14 /srv/mediawiki/php-1.43.0-wmf.6/includes/actions/ActionEntryPoint.php(145): MediaWiki\Actions\ActionEntryPoint->performRequest()
#15 /srv/mediawiki/php-1.43.0-wmf.6/includes/MediaWikiEntryPoint.php(200): MediaWiki\Actions\ActionEntryPoint->execute()
#16 /srv/mediawiki/php-1.43.0-wmf.6/index.php(58): MediaWiki\MediaWikiEntryPoint->run()
#17 /srv/mediawiki/w/index.php(3): require(string)
#18 {main}
Impact
Notes

Seems to be a new issue in 1.43.0-wmf.6

AC:

  • The search indices should be updated with the appropriate fields related to lexemes
  • The lexemes should be re-indexed to ensure that the fields are properly indexed

Event Timeline

I think this is actually the same issue as T365684: Particular lexeme (L1326823) not indexed so search with the Wikidata API returns nothing – the full request URL (from Logstash) shows that it’s a search for “markedsmodning”.

I now see that this is not just for a particular lexeme but for newly created (Danish?) lexemes, e.g., "dyreaktivist" https://www.wikidata.org/w/index.php?go=G%C3%A5&search=L%3Adyreaktivist&search=L%3Adyreaktivist&title=Special%3ASearch&ns0=1 see "dyreaktivist (L1326971)"

Gehel triaged this task as High priority.May 27 2024, 12:41 PM
Gehel moved this task from needs triage to Current work on the Discovery-Search board.
Gehel edited projects, added Discovery-Search (Current work); removed Discovery-Search.

Change #1036566 had a related patch set uploaded (by DCausse; author: DCausse):

[schemas/event/primary@master] search: add missing lexeme fields

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

The search fields specific to Lexemes are currently ignored causing this NOTICE but also preventing lexemes from being searchable (esp. the new ones).
The schemas should be adapted to support these fields and the lexemes will have to be re-indexed.

Change #1036585 had a related patch set uploaded (by DCausse; author: DCausse):

[mediawiki/extensions/WikibaseLexemeCirrusSearch@master] Workaround missing lemma fields

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

Change #1036585 merged by jenkins-bot:

[mediawiki/extensions/WikibaseLexemeCirrusSearch@master] Workaround missing lemma fields

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

Change #1036566 merged by jenkins-bot:

[schemas/event/primary@master] search: add missing lexeme fields

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

Change #1036992 had a related patch set uploaded (by DCausse; author: DCausse):

[operations/deployment-charts@master] cirrus-streaming-updater: use latest image

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

Change #1036992 merged by jenkins-bot:

[operations/deployment-charts@master] cirrus-streaming-updater: use latest image

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

The system should now index lexemes properly.
We still have to reindex all the lexemes to fix the ones created/edited before the fix was applied.