Extension:CirrusSearch/ja

CirrusSearch 拡張機能はElasticsearchを使った MediaWiki 検索を実装します.

このページはインストールに関するものです. インストール後、使用法に関してはを確認してください.

目標

 * ネイティブな依存関係がなくてもインストールが簡単にできること
 * 唯一の依存関係は pure-PHP MediaWiki 拡張機能と Elasticsearch だけ
 * 他の MediaWiki 拡張機能で拡張できるウィキページについて、ほぼリアルタイムに検索インデックスを返す
 * が利用者に開放したクエリオプションすべてと、その他を提供

依存関係

 * PHP and cURL
 * In addition to the standard MediaWiki requirements for PHP, CirrusSearch requires PHP to be compiled with cURL support.
 * Elasticsearch
 * You will need to install Elasticsearch.

Take note that a Java installation like OpenJDK is needed in addition. It's best to use the official Elasticsearch Docker image or a self-hosted version. A managed product like Amazon OpenSearch (formerly Amazon Elasticsearch) can work but may require additional configuration depending on its specifics. For example, Amazon OpenSearch only listens for Elasticsearch API requests over HTTPS on port 443 (i.e. it does not expose the default Elasticsearch port 9200), so a TLS-enabled proxy (e.g. Nginx) can enable CirrusSearch to communicate with an Amazon OpenSearch cluster.


 * Elastica is a PHP library to talk to Elasticsearch. Install Elastica per the instructions below.

を参照してください.
 * その他 :
 * Due to the actual handling of jobs by the CirrusSearch extension, it is advisable to set up jobs in Redis to prevent messages like Notice: unserialize: Error at offset 64870 of 65535 bytes in JobQueueDB.php and subsequent errors like Unsupported operand types.

Even though the instructions below tell you to only run Composer when installing from git, it may be necessary to issue it anyway in order to install all PHP dependencies.

アップグレード
Please follow the upgrade instructions in the CirrusSearch file.

Configuration
The configuration parameters of CirrusSearch are documented at the file. See also documentation on CirrusSearch configuration profiles.

フック
CirrusSearch 拡張機能が規定するフックは他の拡張機能でも利用でき、それぞれのコアのスキーマ拡張と説明文書の変更に使えます. 使用できるフックは次の通りです.


 * - allows to hook into the configuration for analysis
 * - allows configuration of the mapping of fields
 * - allows extensions to modify ElasticSearch document produced from a page
 * - allows extensions to process incoming and outgoing links for the document
 * - called when a batch of pages has been indexed
 * - allows extensions to add query parser features
 * - allows extensions to define rescore builder functions
 * - allows extension to declare various search components and configuration

API
CirrusSearch の機能は API クエリで使用可能です. Searching happens via the normal search API, ; you can use CirrusSearch-specific features, such as the   special prefix to find pages related to Marie Curie and radium: api.php?action=query&list=search&srsearch=morelike:Marie_Curie%7Cradium&srlimit=10&srprop=size&formatversion=2 Custom APIs and parameters are provided for querying CirrusSearch configuration and debug information:


 * module: 2014?action=cirrusdump
 * parameter to Special:Search or search API queries: https://en.wikipedia.org/wiki/Special:Search/cat%20dog%20chicken?cirrusDumpQuery
 * parameter to Special:Search or search API queries: https://en.wikipedia.org/wiki/Special:Search/cat%20dog%20chicken?cirrusDumpResult
 * An additional parameter,, can be passed with   to have the Lucene explanation of the score included with the result dump: https://en.wikipedia.org/wiki/Special:Search/cat%20dog%20chicken?cirrusDumpResult&cirrusExplain It can also be used to get the explanation in a human-readable format, by giving it one of the values  ,   or  , such as: https://en.wikipedia.org/wiki/Special:Search/cat%20dog%20chicken?cirrusDumpResult&cirrusExplain=pretty
 * ,,  ,   modules to obtain dump from the CirrusSearch setup: api.php?action=cirrus-config-dump&formatversion=2

関連項目

 * General links
 * - CirrusSearch usage documentation (needed after the install)
 * ウィキメディアの Cirrus/Elastic 設定に関する情報
 * - 索引作りにさまざまな影響を与える調整可能なパラメータのセット
 * - Enhances Special:Search by providing advanced parameters
 * Debugging
 * Debugging
 * How to determine that Cirrus is actually used as the search backend

Local development
Elastic Search service can be run with the Vagrant role and MediaWiki Vagrant.

For Docker, you can use a command like. Then follow the installation and configuration directions. If your web host is in a container you'll want to make sure the above container is on the same network, and in LocalSettings.php you will want to reference  as the host name. This will not have the WMF plugins but can be sufficient for basic testing.