Page MenuHomePhabricator

API action=wbsearchentities should have an option to return sitelinks too
Open, LowPublic

Description

We're planning on implementing search in the Wikipedia app based on Wikidata, rather than OpenSearch. As the user types, he gets results based on wbsearchentities, and upon tapping a result, is taken to that particular article on the wiki they have chosen in settings.

Current API Call sequence:

  1. Call action=wbsearchentities with what I want to search for.
  2. Get id of what item I'm interested in
  3. Call action=wbgetentities with the id of the item I'm interested in, with parameters sites=<wiki-i-want>&ids=<id-i-want>&props=sitelinks
  4. I get back *all* the sitelinks, and I just pick the one I want and ignore the rest
  5. I parse the exact article title from the sitelink, and navigate the user to that.

This is slow and wasteful. Ideally,

  1. Call action=wbsearchentities with search=<term>&language=<lang>&sitelinks=<wikiname>
  2. I get results, where the sitelink for the wiki(s?) i specified are also in the results
  3. I parse the exact article title from the sitelink, and navigate the user to that.

Just one network call, and a lot less data transfer too.

Details

Reference
bz56748

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 2:17 AM
bzimport set Reference to bz56748.
bzimport added a subscriber: Unknown Object (MLST).

Change 94585 had a related patch set uploaded by Yuvipanda:
Add sites parameter to API action=wbsearchentities

https://gerrit.wikimedia.org/r/94585

Are you going to work more on this Yuvi?

A bit swamped at the moment, Lydia :( Would be awesome if someone else could rebase the patch and get this in.

Added to the sprint (technically) - May be worth a developer finishing it off :)

Change 94585 abandoned by Yuvipanda:
Add sites parameter to API action=wbsearchentities

Reason:
I probably won't have time to spend fixing this anytime soon, and
so many rebase conflicts anyway...

https://gerrit.wikimedia.org/r/94585

Lydia_Pintscher removed a subscriber: Unknown Object (MLST).
Lydia_Pintscher removed a subscriber: Unknown Object (MLST).
Addshore set Security to None.