mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-16 10:59:56 +00:00
1a37edc53f
This code detects a few edge-cases: 1. When some search results are exact matches, make sure they are always at the very top. 2. When the prefixsearch API is used, e.g. as a fallback, redirects show up as a separate metadata structure outside of the pages array. Consider these and stop if there is already an exact match. 3. CirrusSearch returns redirects as part of the pages array. When there is an exact match, make these redirects separate options and add them to the top. All of this is case-insensitive, on purpose. In case two templates with different capitalization exist, we rely on the backend to return both. The code introduced here is fine with this. Notes: * This doesn't guarantee an exact match is always there. This requires an additional HTTP request and is done in the next patch. * I tried to write unit tests for this, but gave up. The setup is complicated. An isolated unit test would not test much anyway. Better test this on-wiki. Bug: T274903 Change-Id: I64e1b5633e7b878a4d0d23d66229ca87e69d0045 |
||
---|---|---|
.. | ||
ve-mw | ||
ve-mw-collab |