| Opensearch |
| Get pages whose name matches a given string. When limit is reached, results are ordered by number of incoming links. |
| Prefix |
|
| Required rights |
read |
| Post only? |
No |
Parameters[edit]
- search – the search string
- limit – maximum amount of results to return (defaults to 10)
- namespace – namespace numbers to search (delimited by
|, defaults to 0)
- suggest – do nothing if
$wgEnableOpenSearchSuggest is false
- format – see below
Error Codes[edit]
- readapidenied – You need read permission to use this module.
Note on case sensitivity[edit]
Page name searches are case-sensitive. If $wgCapitalLinks is true (this is the default), the first letter is case-insensitive. If the TitleKey extension is enabled, page name searches are entirely case-insensitive.
Example[edit]
The opensearch API module handles formats differently. Only XML and JSON (and their formatted versions) are recognized, every other valid format parameter results in JSON. The JSON format returns an array containing the search query and an array of result titles: JSON
| Result |
| The following content has been placed in a collapsed box for improved usability. |
[
"api",
[
"API",
"Apiales",
"Apiaceae",
"Apia",
"Apicomplexa",
"Apicomplexa lifecycle stages",
"Apidae",
"APIA Leichhardt Tigers",
"Apical membrane",
"Apical consonant"
]
]
|
| The above content has been placed in a collapsed box for improved usability. |
The XML format returns an OpenSearch XML file with titles, URLs and short descriptions: XML
| Result |
| The following content has been placed in a collapsed box for improved usability. |
<?xml version="1.0"?>
<SearchSuggestion version="2.0" xmlns="http://opensearch.org/searchsuggest2">
<Query xml:space="preserve">api</Query>
<Section>
<Item>
<Text xml:space="preserve">Application programming interface</Text>
<Description xml:space="preserve">An application programming interface (API) is a particular set of rules and specifications that a software program can follow to access and make use of the services and resources provided by another particular software program that implements that API. </Description>
<Url xml:space="preserve">http://en.wikipedia.org/wiki/Application_programming_interface</Url>
</Item>
<Item>
<Text xml:space="preserve">Apiales</Text>
<Description xml:space="preserve">The Apiales are an order of flowering plants. </Description>
<Url xml:space="preserve">http://en.wikipedia.org/wiki/Apiales</Url>
<Image source="http://upload.wikimedia.org/wikipedia/commons/thumb/e/ef/Umbella.jpg/50px-Umbella.jpg" width="50" height="46" />
</Item>
</Section>
</SearchSuggestion>
|
| The above content has been placed in a collapsed box for improved usability. |
See also[edit]