We were recently bitten (T427935) by having pagination logic split between SearchEntities.php and the ItemPrefixSearch and PropertyPrefixSearch use cases. This logic should move out of SearchEntities.php.
For item and property search, the use cases already take care of pagination, and we simply need to forward the limit and offset values. For all other entity types, the pagination logic needs to move into the corresponding controllers.
Note that depending on T428032 this may need to account for different maximum page limits for wbsearchentities and the /suggest REST routes.
AC:
- no pagination logic in SearchEntities.php
- the band-aid patch https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Wikibase/+/1296650 is undone
- no user-facing changes