Handle redirects during prefix search exact match
authorNik Everett <neverett@wikimedia.org>
Fri, 21 Nov 2014 19:47:32 +0000 (14:47 -0500)
committerNik Everett <neverett@wikimedia.org>
Fri, 21 Nov 2014 19:47:32 +0000 (14:47 -0500)
commit2ec9915816577dbd749625d083e4ee590bf49f6f
tree3415fb43c7651d26eb4f93be7465e82cdef1eaaf
parent21d434948d201bfd2dc0e7a75dac0b5ba4e0c75e
Handle redirects during prefix search exact match

Prefix search attempts to find exact matches to the user's query that aren't
returned by plugins.  In some cases, like when the exact match is a redirect
and the target of the redirect is also in the search results, it would result
in multiple results in prefix search going the same place.  This looks really
silly when the top hit is "Barack obama" (a redirect) and the next one is
"Barack Obama" (the target of the redirect).

This handles a bunch of cases to do with redirects in the matches and when
the exact match is a redirect.

Bug: 736731
Change-Id: I49fe1ccec84bd5d1f44c6b91b260abf50f2cc3a1
includes/PrefixSearch.php
tests/phpunit/MediaWikiTestCase.php
tests/phpunit/includes/PrefixSearchTest.php