Extension:MediaSearch

Category:GPL licensed extensions
MediaWiki extensions manual
MediaSearch
Release status: stableCategory:Stable extensions
Implementation Special page Category:Special page extensions, SearchCategory:Search extensions
Description Provide a rich search experience for media files
Author(s) Structured Data team
Latest version Continuous updates
Compatibility policy Snapshots releases along with MediaWiki. Master is not backward compatible.Category:Extensions with release branches compatibility policy
MediaWiki masterCategory:Extensions with manual MediaWiki version
License GNU General Public License 2.0 or later
Download Category:Extensions in Wikimedia version control
readme
  • $wgMediaSearchAssessmentFilters
  • $wgMediaSearchExternalEntitySearchBaseUri
  • $wgMediaSearchExternalSearchUri
  • $wgMediaSearchAssessmentQuickviewLabels
  • $wgMediaSearchTabOrder
Quarterly downloads 4 (Ranked 92nd)
Translate the MediaSearch extension if it is available at translatewiki.net
Issues Open tasks · Report a bug
Category:All extensions

MediaSearch is an alternative, media-focused way to display search results through the Special:MediaSearch page.

Installation

  • Download and move the extracted MediaSearch folder to your extensions/ directory.
    Developers and code contributors should install the extension from Git instead, using:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/MediaSearch
  • Only when installing from Git, run Composer to install PHP dependencies, by issuing composer install --no-dev in the extension directory. (See T173141 for potential complications.)Category:Extensions requiring Composer with git
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'MediaSearch' );
    
  • Configure as required.
  • While not strictly required, we suggest installing some optional dependencies to enhance the media search experience.
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Optional dependencies

System-level dependencies
  • ElasticSearch (see here for more information on how to install)
MediaWiki dependencies
  • CirrusSearch and dependencies, for improved search results & per-mediatype tab support
  • If you have a Wikibase repository, we strongly recommend also installing these extensions to allow more data to be used to enhance the search results:

Configuration

Extension configuration variables are sets of key-value pairs. They are documented in more detail in extension.json. Config variables should be added to LocalSettings.php. The following config options are available for this extension:

// External search results API (for results from another wiki - e.g. locally testing changes with remote results)
$wgMediaSearchExternalSearchUri = 'https://commons.wikimedia.org/w/api.php';

// External entity search base URI (for autocomplete suggestions, optional)
$wgMediaSearchExternalEntitySearchBaseUri = 'https://www.wikidata.org/w/api.php';

Coding conventions

JavaScript/Vue

As much as possible, we default to the Vue Style Guide.

For now, we are not using full single-file components because we need to be able to compile Less separately so it can be included immediately before the app loads to style the PHP UI.

CSS/Less

Since Wikimedia UI base variables aren't in core, we require them as a package dependency, then use a shell script to copy them to the lib directory. To update the base variables, require the new version in package.json and install it, then run npm run build-lib to copy the updated file into lib. Commit the updated files.

We're including the base variables in our custom variables file, resources/mediasearch-variables.less. To use them in other files, include mediasearch-variables.less rather than directly including the base file itself.

The CSS class name prefix sdms should be used for extension-level components. sd should be used for base components to keep them extension-agnostic, in case we decide to pull them out into a separate library.

See also

Category:Extensions used on Wikimedia#MediaSearch
Category:All extensions Category:Extensions in Wikimedia version control Category:Extensions included in Miraheze Category:Extensions included in WikiForge Category:Extensions requiring Composer with git Category:Extensions used on Wikimedia Category:Extensions with manual MediaWiki version Category:Extensions with release branches compatibility policy Category:GPL licensed extensions Category:GetPreferences extensions Category:Search extensions Category:Special page extensions Category:Stable extensions