CyberCRI / learn-ext

WeLearn Browser Extension
https://welearn.cri-paris.org
MIT License
11 stars 1 forks source link

Switch Wikipedia Search API to use `prefixsearch` action #143

Closed prashnts closed 4 years ago

prashnts commented 4 years ago

We currently use the query endpoint with full-text search generator. (Check out the API sandbox: https://to.noop.pw/wikiapi-sandbox--query).

This works but the search results are not good. Example of what I mean by good is here:

Snip 2020-03-11 at 11 00 18 Snip 2020-03-11 at 11 00 47

Notice in the first example, the exact match is actually the third item in the list, and in second, there is no matches at all.

Compare this with the prefixsearch api used by Wikipedia's search box:

Snip 2020-03-11 at 11 01 02

Solution steps

Relevant comment: https://github.com/CyberCRI/learn-ext/blob/986bbf2f6c453dd6b14310997bc1cb17e83fd67b/src/mixins/wikipedia.js#L174

Also related to #37 .