Descriptions have been removed from the action=opensearch API due to performance concerns and lack of use cases (see T240691: TextExtracts extension frequent slows down opensearch API by several seconds, especially T240691#5757544 for performance and T240691#5742010 for how this is (not) used by browsers).
See API:Opensearch#Response for how the results used to look; the second array now holds empty strings.)
While action=opensearch is an endpoint meant specifically for browsers, and only end-of-life browsers with low usage seem to make use of descriptions, it seems many other clients did use this endpoint, judging from the feedback on various support channels (e.g. 1, 2, 3, 4). Since many mobile apps cannot be easily updated for existing users, there might be value in restoring descriptions to action=opensearch if there's a performant way to do it. Two options came up:
- Use Wikidata descriptions, which are stored in page_props so can be retrieved with a single query. This is a different type of description but arguably more suitable to a search API (the Wikimedia apps display Wikidata descriptions for search, for example).
- Wait for T213505: RfC: OpenGraph descriptions in wiki pages, then build on it to use descriptions from the Page Content Service.
Clients which can update their logic should use the prefixsearch API:
- For descriptions, something like action=query&generator=prefixsearch&gpssearch=<search term>&prop=extracts&exintro=1&explaintext=1&redirects=1 (sandbox) which will give results like
{ "batchcomplete": true, "continue": { "gpsoffset": 10, "continue": "gpsoffset||" }, "query": { "pages": [ { "pageid": 10165010, "ns": 0, "title": "Harry Sassounian", "index": 7, "extract": "Harry M. Sassounian, also known as Hampig Sassounian, is serving a life sentence for the 1982 assassination of Turkish Consul General Kemal Arıkan (or Arikan) at a street intersection in Los Angeles, California, United States. He was born in Beirut, Lebanon." }, { "pageid": 15432681, "ns": 0, "title": "Hampigny", "index": 4, "extract": "Hampigny is a commune in the Aube department in north-central France." } ] } }
- For extracts, something like action=query&generator=prefixsearch&gpssearch=Hampi&prop=description&redirects=1 (sandbox) which will give results like
{ "batchcomplete": true, "continue": { "gpsoffset": 10, "continue": "gpsoffset||" }, "query": { "pages": [ { "pageid": 10165010, "ns": 0, "title": "Harry Sassounian", "index": 7, "description": "American assassin", "descriptionsource": "central" }, { "pageid": 15432681, "ns": 0, "title": "Hampigny", "index": 4, "description": "Commune in Grand Est, France", "descriptionsource": "local" } ] } }