Manual:記事数

This page is a translated version of the page Manual:Article count and the translation is 50% complete.

The article count is the number of content pages on a wiki. It is available from the wiki's Special:Statistics page, from the {{NUMBEROFARTICLES}} magic word, and through a "siteinfo " query via the MediaWiki API.

By default, a page is counted as an article when:

  1. it's in the main namespace (meaning its title doesn't have a prefix like "User:" or "Talk:"),
  2. it contains at least one internal wikilink (e.g. the text "[[Main Page]]" creates a wikilink to the page titled "Main Page"), and
  3. it isn't a redirect.

The first criterion can be expanded to consider other namespaces through the use of the $wgContentNamespaces variable. (Note that some 拡張機能 do this when they are installed.)

The second criterion can be overridden if the $wgArticleCountMethod variable is set to the value "any", in which case all non-redirects in content namespaces are counted as articles. However, when the value "link" is used — which is the default as defined in DefaultSettings.php — only pages containing a wikilink are considered. This includes both stubs and disambiguation pages, provided they contain links.

There is no way to change the third criterion. Redirects are never counted as articles.

MediaWiki の記事数の設定の変更

初期の MediaWiki では、少なくとも 1 つのカンマを含むページを記事としてカウントしていました。 この方法は、カンマにあまり意味のない多くの言語では頼りにならないものでした (この結果につながった過程については、m:Article count reformを参照してください。)

MediaWiki 1.18 の前、記事をカウントする方法として、構成変数$wgUseCommaCount により決定する方法が使用されていましたが、これは同時に廃止予定になり、最終的にMediaWiki 1.24 で除去されました。

1.18 以降は、変数 $wgArticleCountMethod が使用されました。

While article counting based on commas is still relatively common in the wiki world (see, e.g., MeatBall:BiggestWiki), the ability for MediaWiki to do this was completely removed in MediaWiki 1.31 .

最新バージョンの MediaWiki では、リンクの有無はデータベース テーブル上でも見つけることのできる pagelinks のデータベース テーブルと照合し、テンプレートまたはその他のページの参照読み込みによって作成されたリンクを含むかどうか検証します。特定のページの記事の状態を判断するとき、特殊なリンクとしてのカテゴリ リンク (ページをカテゴリに列挙) またはファイル リンク (ファイルを表示) などは数えません。それらのリンクが影響を与えるデータベースが同一ではないからです。

別の方法に変更するには、次のいずれかの手法を使用します:

MediaWiki バージョン:
1.18

MW 1.18 以降

MW 1.17 以前

MediaWiki バージョン:
1.17

記事数の統計の更新

Following a change in article count method you will almost certainly want to recount your wiki to reflect that change (this does not happen automatically). To do so, run updateArticleCount.php from the command line.

データベースのアクセス権限しか保有しない場合、ページリンクのみを検査する(「link」メソッドに類似した)次のようなクエリを実行し、標準名前空間内の記事数の概数を得ることができます。

SELECT count(distinct(page_id))
FROM pagelinks
INNER JOIN page ON pl_from = page_id
WHERE page_namespace = 0
AND page_is_redirect = 0;

関連項目