Lucas_Werkmeister_WMDE created this task.
Lucas_Werkmeister_WMDE added a project: Wikidata.
Restricted Application added a subscriber: Aklapper.

TASK DESCRIPTION
  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 
<https://gerrit.wikimedia.org/r/29956>, reinstated in I28a3d7aca4 
<https://gerrit.wikimedia.org/r/43588>) 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 
<https://www.mediawiki.org/wiki/Special:MyLanguage/Help:ApiSandbox>, 
python-mwapi 
<https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Wikibase/+/43588>, or 
MWAPI 
<https://www.mediawiki.org/wiki/Wikidata_Query_Service/User_Manual/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 
<https://query.wikidata.org/#SELECT%20DISTINCT%20%3Fordinal%20%3Fitem%20%3FitemLabel%20%3FitemDescription%20%3Fimage%20WHERE%20%7B%0A%20%20SERVICE%20wikibase%3Amwapi%20%7B%0A%20%20%20%20bd%3AserviceParam%20wikibase%3Aendpoint%20%22www.wikidata.org%22%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20wikibase%3Aapi%20%22EntitySearch%22%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20mwapi%3Agenerator%20%22wbsearch%22%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20mwapi%3Asearch%20%22Fellowship%22%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20mwapi%3Alanguage%20%22en%22%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20mwapi%3Alimit%20%22max%22.%0A%20%20%20%20%3Fitem%20wikibase%3AapiOutputItem%20mwapi%3Aitem.%0A%20%20%20%20%3Fordinal%20wikibase%3AapiOrdinal%20true.%0A%20%20%7D%0A%20%20%3Fitem%20wdt%3AP31%2Fwdt%3AP279%2a%20%3Ftype.%0A%20%20FILTER%28%3Ftype%20IN%20%28wd%3AQ5%2C%20wd%3AQ17537576%2C%20wd%3AQ12973014%29%29%0A%20%20OPTIONAL%7B%20%3Fitem%20wdt%3AP18%20%3Fimage.%20%7D%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22%5BAUTO_LANGUAGE%5D%2Cen%22.%20%7D%0A%7D%0AORDER%20BY%20ASC%28%3Fordinal%29%0ALIMIT%20100>,
 based on one provided by User:Thomas.lumen on the Contact the development team 
<https://www.wikidata.org/w/index.php?title=Wikidata:Contact_the_development_team&oldid=989996948#Search_for_multiple_(specific)_types_via_wikibase:api_%22EntitySearch%22_running_into_50_record_limit?>
 page, fails to find works such as Q208002 
<https://www.wikidata.org/wiki/Q208002> or Q127367 
<https://www.wikidata.org/wiki/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.

TASK DETAIL
  https://phabricator.wikimedia.org/T229460

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Lucas_Werkmeister_WMDE
Cc: Smalyshev, Lucas_Werkmeister_WMDE, Aklapper, darthmon_wmde, DannyS712, 
Nandana, Lahi, Gq86, GoranSMilovanovic, QZanden, LawExplorer, _jensen, 
rosalieper, Wikidata-bugs, aude, Mbch331
_______________________________________________
Wikidata-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to