请输入您要查询的百科知识:

 

词条 Module:User:Mr. Stradivarius/PrefixIndex/doc
释义

  1. Syntax

  2. Usage

This module provides a Lua interface to PrefixIndex. It contains a single function, prefixIndex, which returns an array of titles with a given prefix. It is meant to be used from other Lua modules, and cannot be used from #invoke.

This module disables caching for pages it is used on, so it should not be deployed on widely used modules or on any pages with heavy traffic to avoid causing undue stress on the servers.

If there are more than 200 matches for a given prefix, this module will only return the first 200. This is due to constraints built into the PrefixIndex interface.

Syntax

prefixIndex(prefix, subpagesOnly)

Usage

First, load the module.

local prefixIndex = require('Module:PrefixIndex').prefixIndex

Then you can use the function to return an array of pages. For example, to get all pages prefixed with User:Example, use this:

local pageArray = prefixIndex('User:Example')

It is possible to specify a second argument, subpagesOnly. Set this to true to limit the search to subpages only.

local pageArray = prefixIndex('User:Example', true)

Setting subpagesOnly to true is equivalent to adding "/" to the end of your prefix.

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/9/20 18:39:08