Include completion search into SearchEngine
authorStanislav Malyshev <smalyshev@gmail.com>
Tue, 26 Jan 2016 21:18:27 +0000 (13:18 -0800)
committerEBernhardson <ebernhardson@wikimedia.org>
Wed, 3 Feb 2016 23:41:49 +0000 (23:41 +0000)
commit027972a20f94492274b36b8d9277d3c36d4d2f9b
treedc692fcc85e0b61cabf294faf5170ac881b12614
parent8aa6c9f43e9b54e4157a5feee42229a9a48b1764
Include completion search into SearchEngine

By default it still uses PrefixSearch and supports PrefixSearchBackend
but it can be deprecated and phased out and SearchEngine extensions used
instead.

New APIs:
- SearchEngine
public function defaultPrefixSearch( $search );
public function completionSearch( $search );
public function completionSearchWithVariants( $search );

Search engines should override:
protected function completionSearchBackend( $search );

Bug: T121430
Change-Id: Ie78649591dff94d21b72fad8e4e5eab010a461df
19 files changed:
autoload.php
includes/PrefixSearch.php
includes/api/ApiOpenSearch.php
includes/api/ApiQueryPrefixSearch.php
includes/search/SearchEngine.php
includes/search/SearchSuggestion.php [new file with mode: 0644]
includes/search/SearchSuggestionSet.php [new file with mode: 0644]
includes/specialpage/SpecialPage.php
includes/specials/SpecialAllPages.php
includes/specials/SpecialChangeContentModel.php
includes/specials/SpecialFileDuplicateSearch.php
includes/specials/SpecialMovepage.php
includes/specials/SpecialPageLanguage.php
includes/specials/SpecialPrefixindex.php
includes/specials/SpecialRecentchangeslinked.php
includes/specials/SpecialUndelete.php
includes/specials/SpecialWhatlinkshere.php
tests/phpunit/includes/search/SearchEnginePrefixTest.php [new file with mode: 0644]
tests/phpunit/includes/search/SearchSuggestionSetTest.php [new file with mode: 0644]