The SearchEntities module and the SpecialItemDisambiguation special page serve the same purpose: the return a list of items that match a given label provided by the user. The necessary code should be consolidated into a TermSearchInteractor class that supports:
- exact and prefix matches (case insensitive)
- matches in any set of languages, considering language fallback
- retrieving the id of the matching entities, along with
- the matched term
- label and description in the user's ui language (using fallback)
- sensible ranking
- adjustable limits
- paging (if easily doable)
TermSearchInteractor, or the search service it uses, could be re-implemented easily based on different mechanism, like Elastic (see T88534 and T86949).