扩展:CirrusSearch

From MediaWiki.org
Jump to navigation Jump to search
This page is a translated version of the page Extension:CirrusSearch and the translation is 62% complete.

Other languages:
English • ‎русский • ‎中文 • ‎日本語
MediaWiki扩展手册
OOjs UI icon advanced.svg
CirrusSearch
发布状态: 稳定版
实现 Search, API , Hook
描述 使用Elasticsearch实现搜索MediaWiki
作者 Nik Everett, Chad Horohoe, Erik Bernhardson
最新版本 持续更新
兼容性方针 主线(master)
MediaWiki 1.23+
PHP 5.4+
数据更新
许可协议 GNU General Public License 2.0 or later
下载
README
  • $wgCirrusSearchServers
  • $wgCirrusSearchMaxRetries
  • $wgCirrusSearchSoftCommitTimeout
  • $wgCirrusSearchHardCommitTimeout
  • $wgCirrusSearchHardCommitMaxPendingDocs
  • $wgCirrusSearchCacheResultTime
  • $wgCirrusSearchCacheCleanupThread
  • $wgCirrusSearchFilterCacheSize
  • $wgCirrusSearchFilterCacheAutowarmCount
  • $wgCirrusSearchQueryResultCacheSize
  • $wgCirrusSearchQueryResultCacheAutowarmCount
  • $wgCirrusSearchDocumentCacheSize
  • many others
翻译CirrusSearch扩展如果在translatewiki.net可用
检查使用和版本矩阵。
Vagrant角色 cirrussearch
问题 开放的工作 · 报告错误

CirrusSearch扩展使用Elasticsearch实现搜索MediaWiki。

This page is for installation. After the install is working, see 幫助:捲雲檢索 for usage.

项目目标

  • 去除使该扩展难以安装的复杂依赖关系
    • 唯一的依赖项应该是纯PHP MediaWiki扩展和Elasticsearch本身
  • 为其他MediaWiki扩展可扩展的Wiki页面提供近实时搜索索引

提供MWSearch 为用户提供的所有查询选项等

依赖性

PHP and cURL
Elasticsearch
  • MediaWiki 1.28.x requires ElasticSearch 2.x.
  • MediaWiki 1.29.x and 1.30.x require ElasticSearch 5.3.x or 5.4.x.
  • MediaWiki 1.31.x and 1.32.x require ElasticSearch 5.5.x or 5.6.x.
  • MediaWiki 1.33.x requires ElasticSearch 6.5.x.

Take note that a Java installation like OpenJDK is needed in addition.

Elastica
  • Elastica is a PHP library to talk to Elasticsearch. Install Elastica per the instructions below.
Other
  • Due to the actual handling of jobs by the CirrusSearch extension, it's 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. See 任务T157759.

Installation

扩展:Elastica

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.


  • 下载文件,并将其放置在您extensions/文件夹中的Elastica目录内。
  • 只有從git安裝才运行Composer来安装PHP依赖,通过发行composer install --no-dev至扩展目录。 (参见T173141了解潜在问题。)
  • 将下列代码放置在您的LocalSettings.php的底部:
    wfLoadExtension( 'Elastica' );
    
  • Yes 完成 – 在您的wiki上导航至Special:Version,以验证扩展已成功安装。

致使用MediaWiki 1.24或更早版本的用户:

上面的说明介绍的是安装此扩展的新方法,它使用wfLoadExtension()。 如果您需要在早期版本(MediaWiki 1.24和更早版本)中安装此扩展,而不是wfLoadExtension( 'Elastica' );,您需要使用:

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

CirrusSearch

  • 下载文件,并将其放置在您extensions/文件夹中的CirrusSearch目录内。
  • 将下列代码放置在您的LocalSettings.php的底部:
    wfLoadExtension( 'CirrusSearch' );
    
  • Now follow the setup instructions in the CirrusSearch README delivered with your extension i.e. $IP/extensions/CirrusSearch/README. Note that all info in it might not apply to your version of the extension, especially the version of Elasticsearch supported.
  • Configure as required.
  • Yes 完成 – 在您的wiki上导航至Special:Version,以验证扩展已成功安装。

致使用MediaWiki 1.24或更早版本的用户:

上面的说明介绍的是安装此扩展的新方法,它使用wfLoadExtension()。 如果您需要在早期版本(MediaWiki 1.24和更早版本)中安装此扩展,而不是wfLoadExtension( 'CirrusSearch' );,您需要使用:

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

Upgrading

Please follow the upgrade instructions in the CirrusSearch UPGRADE file.

Configuration

The configuration options of CirrusSearch are documented at the docs/settings.txt file, and also in the CirrusSearch.php file.

See also documentation on CirrusSearch configuration profiles.

钩子

CirrusSearch extension defines a number of hooks that other extensions can make use of to extend the core schema and modify documents. 以下钩子可用:

API

CirrusSearch features can be used in API queries. 一些示例和查询:

参见

Local development

Elastic Search service can be run with the Vagrant role (cirrussearch) and MediaWiki Vagrant.

For Docker, you can use a command like docker run -d --name elasticsearch -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" elasticsearch:6.8.2. The 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 elasticsearch as the host name. This will not have the WMF plugins but can be sufficient for basic testing.