aboutsummaryrefslogtreecommitdiffstats
path: root/docs/hooks.txt
diff options
context:
space:
mode:
authorPeter Ovchyn <peter.ovchyn@speedandfunction.com>2020-04-15 15:33:15 +0300
committerPeter Ovchyn <peter.ovchyn@speedandfunction.com>2020-05-05 19:35:52 +0300
commit7df7b923da8e6da0a39763091eecea5842cf666c (patch)
treee23ffd6e0d01f6601e80c5ee5da55a2dc7390c8a /docs/hooks.txt
parent4d3fed31a435e7bd24925a154f89a9407670986d (diff)
downloadmediawikicore-7df7b923da8e6da0a39763091eecea5842cf666c.tar.gz
mediawikicore-7df7b923da8e6da0a39763091eecea5842cf666c.zip
rest: Add 'thumbnail' and 'description' fields to the search response
By default, core adds those fields as null to each row. provideThumbnail and provideDescription hooks are introduced. Extension should subscribe on the hooks to provide a thumbnail and description respectively. Bug: T250144 Change-Id: I42c6c8ff9d887a440174af2a21c7921573b06640
Diffstat (limited to 'docs/hooks.txt')
-rw-r--r--docs/hooks.txt15
1 files changed, 15 insertions, 0 deletions
diff --git a/docs/hooks.txt b/docs/hooks.txt
index 42cb793a7eb3..d745e79a79f1 100644
--- a/docs/hooks.txt
+++ b/docs/hooks.txt
@@ -4057,5 +4057,20 @@ $row: The database row for the revision being dumped. DEPRECATED, use $rev inste
$text: The revision text to be dumped. DEPRECATED, use $rev instead.
$rev: The RevisionRecord that is being dumped to XML
+'SearchResultProvideDescription': Called by REST SearchHandler in order to allow
+extensions to fill the 'description' field in search results. Warning: this
+hook as well as SearchResultPageIdentity interface is being under development and still unstable.
+$pageIdentities: an array (string=>SearchResultPageIdentity) where key is pageId.
+&$descriptions: an output array (string=>string|null) where key is pageId and value is either
+a desciption for given page or null
+
+'SearchResultProvideThumbnail': Called by REST SearchHandler in order to allow
+extensions to fill the 'thumbnail' field in rest search results. Warning: this
+hook as well as SearchResultPageIdentity interface is being under development and still unstable.
+$pageIdentities: an array (string=>SearchResultPageIdentity) where key is pageId.
+&$thumbnails: an output array (string=>SearchResultThumbnail|null) where key is pageId and
+value is either a valid SearchResultThumbnail for given page or null
+
+
More hooks might be available but undocumented, you can execute
"php maintenance/findHooks.php" to find hidden ones.