This is in response to the [[ https://meta.wikimedia.org/wiki/Community_Wishlist_Survey_2021/Editing/Warn_when_linking_to_disambiguation_pages | Warn when linking to disambiguation pages ]] wish from the 2021 Community Wishlist Survey.
The idea is that, at least on content projects like Wikipedia, users almost never want to link to disambiguation pages. The theory is many new users link to i.e. [[ https://en.wikipedia.org/wiki/New_York | New York ]] when they really meant [[ https://en.wikipedia.org/wiki/New_York_City | New York City ]] or [[ https://en.wikipedia.org/wiki/New_York_(state) | New York (state) ]]. Thus, when I use VisualEditor's link tool to add insert a link, "New York City" and "New York (state)" should be shown //before// "New York" in the search results.
[[ https://www.mediawiki.org/wiki/Extension:Disambiguator | Extension:Disambiguator ]] integrates with VisualEditor. For instance the icon shown in the search results (via [[ https://www.mediawiki.org/wiki/Extension:PageImages | Extension:PageImages ]]) is the OOUI icon for a disambiguation page. So VE should have prior knowledge that a search result is a disambiguation page. Instead of manipulating the search API backend itself, we can reorder the results on the clientside to show disambiguation pages last since they are rarely desirable.
* Disambiguation pages should show at the bottom of list from top recommendations when linking to a page