Page MenuHomePhabricator

[ES-M3]: Implement label and aliases search for EntitySchemas via the wbsearchentities API
Closed, ResolvedPublic

Description

Based on the investigation in T362005, we decided to enable searching of EntitySchemas by label and aliases via the wbsearchentities API in order to allow selecting EntitySchemas by label/ aliases when editing statements. This API is already being used by the relevant EntitySchema expert.

Analogue to the implementation for other entity types that have labels, we chose to use Elastic (via CirrusSearch) for this search. To do this, we need to add new search fields to Elastic as we can't re-use the labels and labels_all fields from Wikibase (as the MediaWiki side definitions of these require proper entities). Luckily we can still copy and adapt parts of WikibaseCirrusSearch for our needs.

This probably wont affect Special:Search at all as we (are forced to) use different indexes so haslabel:… wont work for EntitySchemas (but that is beyond our scope).

Acceptance criteria:

  • EntitySchemas can be found by label and aliases via wbsearchentities
  • The wbsearchentities results are formatted consistently with other entity types
  • In statements EntitySchemas can be added by label and aliases (this should just work, the correct API is already being used)
  • Language fallback chains are correctly applied when searching for EntitySchemas

Event Timeline

hoo updated the task description. (Show Details)
hoo added a project: Epic.

On Test Wikidata, searching EntitySchemas by label seems to work, but only after they’ve been edited – @dcausse, could you maybe kick off a reindex of the EntitySchema namespace on testwikidatawiki?

Mentioned in SAL (#wikimedia-operations) [2024-12-17T14:27:19Z] <dcausse> T375641: reindexing all EntitySchema pages on testwikidatawiki

I don’t think there’s a difference between empty and unset for labels (empty labels aren’t possible), so that looks correct to me. Thanks!

We’ll see how search works on real Wikidata on Thursday if the train goes well :)

Lucas_Werkmeister_WMDE claimed this task.

It appears to be working \o/ \o/ \o/

Thanks a lot to everyone :)