Page MenuHomePhabricator

Experimental highlighter appears to be required by WikibaseCirrusSearch
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Install Wikibase, CirrusSearch and WikibaseCirrusSearch on a wiki, including the org.wikimedia.search:extra plugin (but not the org.wikimedia.search.highlighter:experimental-highlighter-elasticsearch-plugin plugin)
  • Add an item to the wiki (or, if it already had an item, rebuild the search index)
  • Search for the item using the regular search (works)
  • Search for the item using wbsearchentities

What happens?:
No results. If you add a lot of var_export()s in random places (have fun! editor’s note: this was not fun), you’ll eventually find that the $mresults in CirrusSearch\Searcher::searchOne() contains, deeply nested, something like this:

'failures' => 
  array (
    0 => 
    array (
      'shard' => 0,
      'index' => 'mediawiki_content_first',
      'node' => 'rHjo5kMtQ6uGWoUXTiFAcw',
      'reason' => 
      array (
        'type' => 'illegal_argument_exception',
        'reason' => 'unknown highlighter type [experimental] for the field [title]',
      ),
    ),
  ),

And if you scroll further up, you’ll see that the query includes things like (note the first and last line):

'highlight' => 
array (
  'pre_tags' => 
  array (
    0 => '',
  ),
  'post_tags' => 
  array (
    0 => '',
  ),
  'fields' => 
  array (
    'title' => 
    array (
      'type' => 'experimental',

So apparently, CirrusSearch or WikibaseCirrusSearch (not sure which) now require the experimental highlighter plugin, even if $wgCirrusSearchUseExperimentalHighlighter is not set to true. I don’t know if this is supposed to be autodetected (based on whether the plugin is installed or not) but the detection broke, or if the plugin is supposed to be a hard dependency (like the extra plugin) but nobody remembered to document this.

What should have happened instead?:
There should be search results, or the requirement for the experimental highlighter to be installed should be documented.

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):
MediaWiki 1.39. I haven’t tested this on a later version; that said, from looking at the getHighlightingConfiguration() methods in WikibaseCirrusSearch’s src/ElasticTermResult.php and src/EntityResultType.php, I get the feeling that the highlighter is still required on the master branch (and the README still doesn’t document this).

Event Timeline

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

Anyway, after installing the plugin, wbsearchentities works \o/

Change #1069149 had a related patch set uploaded (by Lucas Werkmeister; author: Lucas Werkmeister):

[mediawiki/extensions/WikibaseCirrusSearch@master] Document dependency on experimental highlighter plugin

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

Change #1069149 merged by jenkins-bot:

[mediawiki/extensions/WikibaseCirrusSearch@master] Document dependency on experimental highlighter plugin

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

Change #1069947 had a related patch set uploaded (by Lucas Werkmeister; author: Lucas Werkmeister):

[mediawiki/extensions/WikibaseCirrusSearch@REL1_42] Document dependency on experimental highlighter plugin

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

Change #1069948 had a related patch set uploaded (by Lucas Werkmeister; author: Lucas Werkmeister):

[mediawiki/extensions/WikibaseCirrusSearch@REL1_41] Document dependency on experimental highlighter plugin

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

Change #1069949 had a related patch set uploaded (by Lucas Werkmeister; author: Lucas Werkmeister):

[mediawiki/extensions/WikibaseCirrusSearch@REL1_39] Document dependency on experimental highlighter plugin

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

Change #1069948 merged by jenkins-bot:

[mediawiki/extensions/WikibaseCirrusSearch@REL1_41] Document dependency on experimental highlighter plugin

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

Change #1069949 merged by jenkins-bot:

[mediawiki/extensions/WikibaseCirrusSearch@REL1_39] Document dependency on experimental highlighter plugin

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

Change #1069947 merged by jenkins-bot:

[mediawiki/extensions/WikibaseCirrusSearch@REL1_42] Document dependency on experimental highlighter plugin

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

LucasWerkmeister claimed this task.

Feel free to reopen if you want to make the experimental highlighter plugin an optional dependency after all, but otherwise I think this is resolved.