MediaWiki API 說明

此頁為自動產生的 MediaWiki API 說明文件頁面。

說明文件與範例:https://www.mediawiki.org/wiki/API

list=search <pre>(sr) </pre>

(main | query | search)
  • 此模組需要讀取權限。
  • 此模块可作为发生器使用。
  • 来源:MediaWiki
  • 许可协议:GPL-2.0+

执行一次全文本搜索。

參數:
srsearch

搜索所有匹配此值的页面标题或内容。根据wiki的搜索后端工具,您可以使用搜索字符串以调用特殊搜索功能。

此參數為必填。
srnamespace

只在这些名字空间搜索。

多值 (以 | 分隔):0、1、2、3、4、5、6、7、8、9、10、11、12、13、14、15、2300、2301、2302、2303
預設值:0
srwhat

要执行的搜索类型。

單值:title、text、nearmatch
srinfo

要返回的元数据。

多值 (以 | 分隔):totalhits、suggestion、rewrittenquery
預設值:totalhits|suggestion|rewrittenquery
srprop

要返回的属性:

size
Adds the size of the page in bytes.
wordcount
Adds the word count of the page.
timestamp
Adds the timestamp of when the page was last edited.
snippet
Adds a parsed snippet of the page.
titlesnippet
Adds a parsed snippet of the page title.
redirecttitle
Adds the title of the matching redirect.
redirectsnippet
Adds a parsed snippet of the redirect title.
sectiontitle
Adds the title of the matching section.
sectionsnippet
Adds a parsed snippet of the matching section title.
isfilematch
Adds a boolean indicating if the search matched file content.
categorysnippet
Adds a parsed snippet of the matching category.
score
Deprecated and ignored.
hasrelated
Deprecated and ignored.
多值 (以 | 分隔):size、wordcount、timestamp、snippet、titlesnippet、redirecttitle、redirectsnippet、sectiontitle、sectionsnippet、isfilematch、categorysnippet、score、hasrelated
預設值:size|wordcount|timestamp|snippet
sroffset

当更多结果可用时,使用这个继续。

类型:整数
預設值:0
srlimit

要回傳的頁面總數。

不允許超過 50 (機器人為 500)。
类型:整数或max
預設值:10
srinterwiki

搜索结果中包含跨wiki结果,如果可用。

类型:布尔值(详细信息
srenablerewrites

Enable internal query rewriting. Some search backends can rewrite the query into one its thinks gives better results, such as correcting spelling errors.

类型:布尔值(详细信息