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:
- Call action=wbsearchentities with what I want to search for.
- Get id of what item I'm interested in
- 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
- I get back *all* the sitelinks, and I just pick the one I want and ignore the rest
- I parse the exact article title from the sitelink, and navigate the user to that.
This is slow and wasteful. Ideally,
- Call action=wbsearchentities with search=<term>&language=<lang>&sitelinks=<wikiname>
- I get results, where the sitelink for the wiki(s?) i specified are also in the results
- 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.