Page MenuHomePhabricator

Make wbsearchentities work for search by term
Open, Needs TriagePublic8 Estimated Story Points

Description

As an editor on a Wikibase with federated properties enabled, I want to be able to search for both local and remote properties by label so that I can add statements to local entities.

For this story, we would ignore any UI styling concerns (e.g. how federated vs local properties are displayed in results). We will also not worry about how searching by property ID should work for local/remote properties with the same ID.

BDD
GIVEN I have a local Property "instagram id"
AND my Wikibase is connected to a remote Wikibase with a Property "instance of"
WHEN I use "insta" as the search term for wbsearchentities
THEN I get a response containing the local Property "instagram id" and the Federated Property "instance of"

Event Timeline

Rosalie_WMDE renamed this task from Make wbsearchentities work for term search to Make wbsearchentities work for search by term.Thu, Jul 15, 1:24 PM

CirrusSearch defines its own EntitySearch callback and we don't want to change it, because that's the point of allowing other places to override services.

Two ideas how to go around that:

  1. EntitySearchHelperCallbacks in ServiceWiring will return a combined search helper with an existing EntitySearchHelper for property and ApiEntitySearchHelper if feddy props is enabled.
  2. Wrap TypeDispatchingEntitySearchHelper in a service that dispatches either to the inner TypeDispatchingEntitySearchHelper or to a combined search helper with an existing EntitySearchHelper for property

We think 2) is better because it allows us to gradually change all places where we want search to work with federated properties.