Page MenuHomePhabricator

Remove all CirrusSearch dependencies from Wikibase
Open, MediumPublic

Description

Some Wikibase classes are still dependent on CirrusSearch:

  • TermLookupSearcher
  • ElasticTermLookup
  • MoreLikeWikibase

We should try to remove them so that Wikibase alone does not depend on CirrusSearch.
So that we don't need either stubs for phan (https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Wikibase/+/541230) nor importing CirrusSearch when testing Wikibase (https://gerrit.wikimedia.org/r/c/integration/config/+/541227)

Event Timeline

An exact list of dependencies (from https://integration.wikimedia.org/ci/job/mwext-php72-phan-docker/14746/console):

<checkstyle version="6.5">
  <file name="client/includes/MoreLikeWikibase.php">
    <error line="11" severity="error" message="Class extends undeclared class \CirrusSearch\Query\MoreLikeFeature" source="PhanUndeclaredExtendedClass"/>
    <error line="18" severity="warning" message="Parameter $context has undeclared type \CirrusSearch\Search\SearchContext" source="PhanUndeclaredTypeParameter"/>
    <error line="19" severity="error" message="Reference to undeclared class \CirrusSearch\Query\MoreLikeFeature" source="PhanUndeclaredClass"/>
  </file>
  <file name="lib/includes/Store/Elastic/ElasticTermLookup.php">
    <error line="57" severity="error" message="Call to method __construct from undeclared class \CirrusSearch\Connection" source="PhanUndeclaredClassMethod"/>
    <error line="58" severity="error" message="Reference to constant INDEX_BASE_NAME from undeclared class \CirrusSearch\SearchConfig" source="PhanUndeclaredClassConstant"/>
  </file>
  <file name="lib/includes/Store/Elastic/TermLookupSearcher.php">
    <error line="15" severity="error" message="Class extends undeclared class \CirrusSearch\ElasticsearchIntermediary" source="PhanUndeclaredExtendedClass"/>
    <error line="37" severity="warning" message="Parameter $conn has undeclared type \CirrusSearch\Connection" source="PhanUndeclaredTypeParameter"/>
    <error line="38" severity="error" message="Reference to undeclared class \CirrusSearch\ElasticsearchIntermediary" source="PhanUndeclaredClass"/>
    <error line="50" severity="warning" message="Return type of newLog() is undeclared type \CirrusSearch\RequestLog" source="PhanUndeclaredTypeReturnType"/>
    <error line="51" severity="error" message="Call to method __construct from undeclared class \CirrusSearch\SearchRequestLog" source="PhanUndeclaredClassMethod"/>
  </file>
</checkstyle>
EBernhardson moved this task from needs triage to Wikibase Search on the Discovery-Search board.

AFAICS, TermLookupSearcher and ElasticTermLookup seem to be gone, and MoreLikeWikibase is the only one left.