Jump to content

Manual:$wgExternalQuerySources

From mediawiki.org
Access: $wgExternalQuerySources
Configuration for external query sources.
Introduced in version:1.45.0 (Gerrit change 1195427; git #3ad72257)
Removed in version:Still in use
Allowed values:(object)
Default value:[]

Details

Configuration for external query sources. This allows system administrators to off-load expensive QueryPage subclasses to alternative query sources by fetching results over HTTP. For example, you might periodically run your own version of a query via Hadoop, and serve the result as a JSON file from a static HTTP server. (phab:T309738) While your external source will likely be a static file serving cached results, MediaWiki will treat this external source as drop-in replacement for the database, not as replacement for the cache. This means if you enable $wgMiserMode, your external service does not require high-availability and high-traffic support because you still benefit from persistent cache (in the querycache table) and offline pull (via maintenance/updateSpecialPages.php, instead of a live user request).

Example:

$wgExternalQuerySources = [
	'Mostlinkedtemplates' => [
		'enabled' => true,
		'url' => 'https://example.org/data/Mostlinkedtemplates.json',
		'timeout' => 10, // seconds, optional
	]
];