Extension:GoogleCustomWikiSearch

From mediawiki.org
This page is a translated version of the page Extension:GoogleCustomWikiSearch and the translation is 100% complete.
This extension is professionally maintained by the WikiTeq team.
WikiTeq provides official support for MediaWiki LTS releases only. It may work with other MediaWiki releases.
MediaWiki 拡張機能マニュアル
GoogleCustomWikiSearch
リリースの状態: 安定
実装 特別ページ
説明 MediaWikiとGoogleカスタム検索またはGoogleサイト検索との統合を可能にする。
作者 Ike Hecht (tosfosトーク)
メンテナー WikiTeq team
最新バージョン 0.6.0 (2021年7月)
互換性の方針 長期間サポート リリースであるすべての MediaWiki リリースについて、拡張機能に対応するブランチが存在します。
MediaWiki 1.31-1.35, 1.39
データベースの変更 いいえ
Composer mediawiki/googlecustomwikisearch
ライセンス GNU 一般公衆利用許諾書 2.0
ダウンロード

  • $wgGoogleCustomWikiSearchId
  • $wgGoogleCustomWikiSearchReplaceSearch
  • $wgGoogleCustomWikiSearchAppendToSearch
  • $wgGoogleCustomWikiSearchTheme
  • $wgGoogleCustomWikiSearchCodeVersion
  • $wgGoogleCustomWikiSearchOptions
Quarterly downloads 14 (Ranked 130th)
translatewiki.net で翻訳を利用できる場合は、GoogleCustomWikiSearch 拡張機能の翻訳にご協力ください
問題点 未解決のタスク · バグを報告

The Google Custom Wiki Search extension allows MediaWiki integration with Google Custom Search or Google Site Search.

使用法

Defines a special page (Special:GoogleCustomWikiSearch) that performs a Google search on the wiki. These results can also optionally be appended to the standard wiki search or can replace the built-in search functionality.

ダウンロード

拡張機能は、Git から直接取得できる場合があります [?]:

  • コードを参照
  • 一部の拡張機能には安定版リリースのタグがあります。
    • タグを参照
    • タグを選択します
    • 「スナップショット」をクリックします
  • 各ブランチは過去の MediaWiki リリースと関連付けられています。 最新のアルファ バージョンを含む「master」ブランチもあります (MediaWiki のアルファ バージョンが必要な場合用)。

スナップショットを展開して、MediaWiki インストレーション内の extensions/GoogleCustomWikiSearch/ ディレクトリに配置します。

git に馴染みがあり、かつサーバーにシェルでアクセスできる場合は、拡張機能を以下のようにして取得することもできます:

cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/GoogleCustomWikiSearch.git

インストール

  • ダウンロードして、ファイルをextensions/フォルダー内のGoogleCustomWikiSearchという名前のディレクトリ内に配置します。
    開発者とコード寄稿者は、上記の代わりに以下を使用してGitからインストールします:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/GoogleCustomWikiSearch
  • 以下のコードを LocalSettings.php ファイルの末尾に追加します:
    wfLoadExtension( 'GoogleCustomWikiSearch' );
    
  • Configure as required
  • Yes 完了 – ウィキの「Special:Version」に移動して、拡張機能が正しくインストールされたことを確認します。

MediaWiki 1.35以前を稼働させている利用者へ:

上記の手順では、wfLoadExtension()を使用してこの拡張機能をインストールする新しい方法を記載しています。 この拡張機能をこれらの過去のバージョン (MediaWiki 1.35以前) にインストールする必要がある場合は、wfLoadExtension( 'GoogleCustomWikiSearch' );の代わりに以下を使用する必要があります:

require_once "$IP/extensions/GoogleCustomWikiSearch/GoogleCustomWikiSearch.php";

設定

Important: The global names were changed in version 0.3!

基本

  • $wgGoogleCustomWikiSearchId - Google Custom Search ID - requires account with Google. The ID can be found in your GCS control panel under "basic information". Note that if this is left blank (not set in LocalSettings), the result will be a Google site search. (Note: There is a bug in the current version. If this parameter is left blank, you must set $wgGoogleCustomWikiSearchCodeVersion = 1;.)
  • $wgGoogleCustomWikiSearchReplaceSearch - Set to true to completely replace the MediaWiki search engine with a Google search. Defaults to false.
  • $wgGoogleCustomWikiSearchAppendToSearch - Append to standard search results? Only makes sense if $wgGoogleCustomWikiSearchReplaceSearch is false.

高度な設定

  • $wgGoogleCustomWikiSearchTheme - This may be overwitten by Control Panel settings in Google script Version 2. Possible values are: 'DEFAULT', 'BUBBLEGUM', 'ESPRESSO', 'GREENSKY', 'MINIMALIST', 'SHINY'
  • $wgGoogleCustomWikiSearchCodeVersion - What version of Google's script we should use. This defaults to Version 2, which allows customization in your GCS Control Panel. Can also be set to 1, which was the default in version < 0.3.
  • $wgGoogleCustomWikiSearchOptions - For those who want additional customization, set this instead of $gcwsID (which will be ignored if this is set). Set this variable to equal the insertion code provided by Google. Support for this feature is somewhat experimental.
It should be set similar to this example:
$wgGoogleCustomWikiSearchOptions = <<<END
    var customSearchOptions = {};
    var orderByOptions = {};
/* lots of other Google code here */
END;
Note: The custom search options variable may leave out customSearchControl.draw, though options will only display then if the variable is named "options".

関連項目