Expose SearchEngine specific profiles
authordcausse <dcausse@wikimedia.org>
Thu, 31 Mar 2016 09:13:21 +0000 (11:13 +0200)
committerdcausse <dcausse@wikimedia.org>
Mon, 30 May 2016 18:43:53 +0000 (20:43 +0200)
commit31680aaddc8ddde150aa5ab2370a019a550f259d
tree6f9e12bb8632491a5d0332004efc2fa4cb94f8cd
parente724d14495561be8f80c7bba4e81476cb3fb9d3d
Expose SearchEngine specific profiles

This patch introduces a way for SearchEngine implementations to expose
specific search profiles useful to fine-tune the various behaviors related to
search.

A SearchEngine can expose a list of profiles by overriding
SearchEngine::getProfiles( $profileType ), profileType stands for the type of
profile being customized. Two types are added in this patch:
- completion: exposed by ApiQueryPrefixSearch and ApiOpenSearch to control
  the behavior of the algorithm behind "search as you type" suggestions.
- fulltext query independent profiles: exposed by ApiQuerySearch to customize
  query indpendent ranking profiles (e.g. boost by templates/incoming
  links/popularity/...)

This patch allows api consumers that might have been confused by fuzzy
suggestions to switch to stricter profiles and to officialize the behavior
behind the hidden param cirrusUseCompletionSuggester. Or to control the
fulltext ranking behaviors like cirrusBoostLinks=(yes|no).

The list of profiles can be discovered by using ApiSandbox/ApiHelp and is totally
controlled by search engine implementations.

Bug: T132477
Change-Id: I66be724d8975976c98c91badbf421f237e014f89
autoload.php
includes/api/ApiOpenSearch.php
includes/api/ApiQueryPrefixSearch.php
includes/api/ApiQuerySearch.php
includes/api/SearchApi.php [new file with mode: 0644]
includes/api/i18n/en.json
includes/api/i18n/qqq.json
includes/search/SearchEngine.php