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