TrashMonks/cryptogull

Improve Searching

egocarib opened this issue · 1 comments

?wiki commonly leaves out relevant results, or returns nothing at all. This is because it uses the opensearch API, which essentially only search the beginning of page titles (with some built in fuzzy logic for misspellings). ?wikisearch does a better job finding pages in scenarios where the search term doesn't match the beginning of any page name. It instead uses the list=search API.

A good example is "healing". Searching for this term with ?wiki healing returns 0 results. However, searching using ?wikisearch healing returns quite a few useful results.

We should update our ?wiki command to take advantage of the list=search API, either by switching to that API entirely, or by falling back to it when opensearch returns no results. A case could be made for either option. For example, opensearch might arguably be considered to give better results for "bear" than list=search, because it looks to page titles first. We should try out a few terms and see what we think is best.

Here are some examples to play with in the API sandbox:

Relevant code methods that could need updating: