/w/rest.php/v1/search/.
GET /v1/search/page
Performs a full-text search across page bodies and titles. Results are ranked by relevance and deduplicated — if a search result is a redirect, the response returns the redirect target page instead.Query parameters
The search query string. Supports the same syntax as the wiki’s standard search (boolean operators, phrase matching, and field-specific queries when the search backend supports them).
The maximum number of results to return. Minimum:
1. Maximum: 100.Response
An array of matching page objects.
GET /v1/search/title
Performs a title prefix completion search — returns pages whose titles begin with or closely match the query. This endpoint is optimized for autocomplete use cases and uses the search engine’s completion (suggestion) mode.Query parameters
The title prefix or partial title to match against. The search engine may also return fuzzy or variant matches depending on backend configuration.
The maximum number of suggestions to return. Minimum:
1. Maximum: 100.Response
Same structure asGET /v1/search/page — a pages array of page objects. The excerpt field contains the suggestion text from the completion engine rather than a body snippet.
Caching
Completion search responses (/v1/search/title) are cached by the server when the wiki allows public reading. The Cache-Control header reflects the $wgSearchSuggestCacheExpiry configuration value. Full-text search responses (/v1/search/page) follow standard REST API caching behavior.
Search backends
The search results returned by both endpoints depend on the wiki’s configured search backend.Built-in search (CirrusSearch not installed)
Built-in search (CirrusSearch not installed)
When no external search engine is configured, MediaWiki uses its built-in SQL-based search engine. Full-text search queries the
searchindex table using the database’s native full-text search capabilities. Title completion uses simple prefix matching against page titles. Result quality is limited compared to dedicated search engines.CirrusSearch (Elasticsearch / OpenSearch)
CirrusSearch (Elasticsearch / OpenSearch)
Wikimedia wikis and many large installations use the CirrusSearch extension, which indexes pages in Elasticsearch or OpenSearch. CirrusSearch provides significantly better relevance ranking, support for complex query syntax, fuzzy matching, language-aware stemming, and cross-namespace search. The
description and thumbnail fields in search results are populated when CirrusSearch is combined with extensions like Wikidata and PageImages.