MediaWiki API 幫助
這是自動生成的MediaWiki API文檔頁面。
文檔和例子:https://www.mediawiki.org/wiki/API:Main_page/zh
list=search (sr)
- 此模塊需要讀取權限。
- 此模塊可作為發生器使用。
- 來源: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
- 添加頁面大小,單位為字節。
- 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
啟用內部查詢重寫。一些搜索后端可以重寫查詢到它認為會給出更好結果的地方,例如糾正拼寫錯誤。
- 類型:布爾值(詳細信息)
例子: