Page MenuHomePhabricator

Search results endpoint returns mixed variants regardless of Accept-Language header
Open, MediumPublicBUG REPORT

Event Timeline

Tsevener triaged this task as Medium priority.Feb 1 2021, 11:20 PM
Tsevener added a project: Discovery-Search.
Tsevener updated the task description. (Show Details)

@cooltey awesome, thanks! That gets us closer to having all the variant information. Looks we also need to append |info to the prop key in order for &inprop=varianttitles to work.

Question for you or anyone else that can answer - it doesn't seem like we'll have variant information for the redirected page titles or descripitions. See here for example:

It returns an object like

"redirects": [{
	"index": 1,
	"from": "\u7f8e\u570b",
	"to": "\u7f8e\u56fd"

Seems like we can look up the to value variants by looking for a title value under pages that matches, but what about from (we have a "Redirected from: nnnn" subtitle in some of our cells on search results)? The same goes for page descriptions, is there a way to get those variants?

"pageid": 153133,
"ns": 0,
"title": "\u7f8e\u570b\u570b\u6c11\u8b66\u885b\u968a",
"index": 20,
"description": "\u90e8\u961f",
"descriptionsource": "central",
"thumbnail": {
	"source": "",
	"width": 120,
	"height": 120


We are not handling the description or "redirected from XXX" for the search results since the API only returns the default one in zhwiki, and looks like there's no way to get the correct one easily.

If you have a strong feeling to fix it, you can call /page/summary/ to update each search result, which was my previous solution for this, but I choose not to process that because of the trade-off in loading speed.

@cooltey ok cool, thanks for confirming! @James_Dempsey I'll leave this task open since it would be nice to get it in the same call if possible, but it sounds like we'll probably match what Android is doing and show the un-converted redirect titles and descriptions for now.