As an API user, I want to use the action=wbsearchentities, action=query&list=wbsearch or action=query&generator=wbsearch APIs like any other MediaWiki API, using the standard continuation framework introduced around MediaWiki 1.25/1.26, in order to avoid having to write custom code.
As a Wikidata Query Service user, I want MWAPI to automatically follow wbsearchentities continuation, in order to work with more search results.
Problem:
SearchEntities’ current continuation support (introduced in I03991a2921, reinstated in I28a3d7aca4) predates the current MediaWiki API continuation framework (ApiBase::getContinuationManager() and various ApiContinuationManager methods); instead, it returns a search-continue property and expects API users to turn that into the continue parameter for the next request. This means that API clients that support automatic continuation (e. g. API Sandbox, python-mwapi, or MWAPI) don’t support it for action=wbsearchentities, nor is continuation possible at all when using wbsearchentities with action=query (as list or generator), since the search-continue is not exposed in that case.
Example:
Open [action=query&list=wbsearch&wbssearch=and in the API sandbox](https://www.wikidata.org/wiki/Special:ApiSandbox#action=query&format=json&list=wbsearch&wbssearch=and) and make the request. Compare with [action=query&list=search&srsearch=and](https://www.wikidata.org/wiki/Special:ApiSandbox#action=query&format=json&list=search&srsearch=and): it has a “continue” button at the bottom to automatically apply continuation and make the next request. With entity search, this currently doesn’t work.
This query, based on one provided by User:Thomas.lumen on the Contact the development team page, fails to find works such as Q208002 or Q127367, because they’re not in the first set of search results and there’s no continuation for later search results.
Acceptance criteria:
- action=wbsearchentities supports continuation.
- action=query&list=wbsearch supports continuation.
- action=query&generator=wbsearch supports continuation.