jquery.uls icon indicating copy to clipboard operation
jquery.uls copied to clipboard

Search results are questionable.

Open JohnMcLear opened this issue 5 years ago • 4 comments

Shouldn searching for "english" return

"English", "English (British)"

or at least

"English", "British English"```

?

Currently it just returns "English".

JohnMcLear avatar Apr 02 '20 10:04 JohnMcLear

It does return British English if it is one of the possible languages. For example, if you select the user interface language in Wikipedia, searching for English will show "British English", "Canadian English", "English", "Patois" (Jamaican), and "Ænglisc" (Old English). The language list is initialized separately for each instance, and the whole list is not always shown. Some instances include British English and some don't.

amire80 avatar Apr 02 '20 10:04 amire80

image

image

I don't just open issues for fun y'know ;)

JohnMcLear avatar Apr 02 '20 10:04 JohnMcLear

Oh drat. Sorry. I know why: Because on Wikipedia we also use the search service, which is separate from this jquery package.

amire80 avatar Apr 02 '20 11:04 amire80

Amir is right, the jquery.uls library only providers rudimentary prefix matching by default. You can supply the searchAPI parameter, e.g. https://www.mediawiki.org/w/api.php?action=languagesearch&format=json&formatversion=2.

You can also implement your own backend. We could also implement word-matching client side.

Nikerabbit avatar Apr 02 '20 12:04 Nikerabbit