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、102、103、108、109、274、275、2300、2301、2302、2303
預設值:0
srwhat

要执行的搜索类型。

單值:title、text、nearmatch
srinfo

要返回的元数据。

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

要返回的属性:

size
添加页面大小,单位为字节。
wordcount
添加页面的字数。
timestamp
添加页面上次编辑时的时间戳。
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
已弃用并已忽略。
hasrelated
Deprecated and ignored.
多值 (以 | 分隔):size、wordcount、timestamp、snippet、titlesnippet、redirecttitle、redirectsnippet、sectiontitle、sectionsnippet、isfilematch、categorysnippet、score、hasrelated
預設值:size|wordcount|timestamp|snippet
sroffset

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

类型:整数
預設值:0
srlimit

要回傳的頁面總數。

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

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

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

启用内部查询重写。一些搜索后端可以重写查询到它认为会给出更好结果的地方,例如纠正拼写错误。

类型:布尔值(详细信息