Ekstensi:CirrusSearch
CirrusSearch Status rilis stabil |
|
---|---|
Implementasi | Pencarian, API , Hook |
Deskripsi | Implements searching for MediaWiki using Elasticsearch |
Perancang awal | Nik Everett, Chad Horohoe, Erik Bernhardson |
Versi terbaru | continuous updates |
Kebijakan kompatibilitas | Snapshots releases along with MediaWiki. Master is not backward compatible. |
MediaWiki | >= 1.43 |
Composer | mediawiki/cirrussearch |
Lisensi | Lisensi Publik Umum GNU 2.0 atau lebih baru |
Unduh | README |
|
|
|
|
|
|
Quarterly downloads | 264 (Ranked 19th) |
Public wikis using | 1,226 (Ranked 212nd) |
Terjemahkan ekstensi CirrusSearch jika tersedia di translatewiki.net | |
Vagrant role | cirrussearch |
Masalah | Tugas terbuka · Laporkan kekutu |
The CirrusSearch extension implements searching for MediaWiki using Elasticsearch.
CirrusSearch has been slated for migration to use OpenSearch as its backend, but this decision is being reviewed based on a late August 2024 blog post from the upstream provider of the current search backend concerning its licensing. Please see Wikimedia Search Platform/Decision Records/Search backend replacement technology for more information. |
Elasticsearch is a standalone third-party software you must install as a requirement for this extension. It is a database system that provides search and indexing functionality, where the current text of your wiki pages gets indexed for faster and improved search results. The communication between MediaWiki and ElasticSearch is done through web services.
See also the help page on using this extension.
Goals
- No native dependencies that would make this difficult to install.
The only dependencies are pure-PHP, MediaWiki extensions, and Elasticsearch itself.
- Provide a near-real-time search index for wiki pages that's extendable by other MediaWiki extensions.
- Provide all of the query options MWSearch has given users, and more.
Dependencies
- PHP dan cURL
In addition to the standard MediaWiki requirements for PHP, CirrusSearch requires PHP to be compiled with cURL support.
- Elasticsearch
You must install Elasticsearch.
Every version of ElasticSearch changes how web services work and causes compatibility problems. You must install the version of Elastic Search compatible with the version of MediaWiki you are currently using:
Elasticsearch versions before 6.8 are incompatible with PHP 8+.
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 that makes CirrusSearch talk to Elasticsearch. Install Elastica per the instructions below.
- Lainnya
- 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.
Lihat task T157759.
Pemasangan
Even though the instructions below tell you only to run Composer when installing from git, it may be necessary to issue it anyway to install all PHP dependencies.
- Unduh dan letakkan berkas-berkasnya di dalam sebuah direktori yang bernama
Elastica
di folderextensions/
Anda.
Developers and code contributors should install the extension from Git instead, using:cd extensions/
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Elastica - Hanya ketika memasang dari git, jalankan Composer untuk memasang dependensi PHP, dengan menjalankan
composer install --no-dev
di direktori ekstensi. (Lihat task T173141 untuk komplikasi yang mungkin terjadi.) - Tambahkan kode berikut di bagian bawah LocalSettings.php Anda:
wfLoadExtension( 'Elastica' );
- Selesai – Telusuri ke Special:Version di wiki Anda untuk memastikan ekstensinya berhasil dipasang.
CirrusSearch
- Unduh dan letakkan berkas-berkasnya di dalam sebuah direktori yang bernama
CirrusSearch
di folderextensions/
Anda.
Developers and code contributors should install the extension from Git instead, using:cd extensions/
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/CirrusSearch - Hanya ketika memasang dari git, jalankan Composer untuk memasang dependensi PHP, dengan menjalankan
composer install --no-dev
di direktori ekstensi. (Lihat task T173141 untuk komplikasi yang mungkin terjadi.) - Tambahkan kode berikut di bagian bawah LocalSettings.php Anda:
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.
- Selesai – Telusuri ke Special:Version di wiki Anda untuk memastikan ekstensinya berhasil dipasang.
Enable regex queries
This is an optional step. You will need to install the search-extra plugin for this. Do so by following these steps:
- execute the following command:
/usr/share/elasticsearch/bin/elasticsearch-plugin/elasticsearch-plugin install org.wikimedia.search:extra:7.10.2-wmf12
- add the following line to your
LocalSettings.php
file:$wgCirrusSearchWikimediaExtraPlugin[ 'regex' ] = [ 'build', 'use', 'max_inspect' => 10000 ];
- restart Elasticsearch with the following command:
systemctl restart elasticsearch
- recreate the search index by executing the following commands:
php path/to/extensions/CirrusSearch/maintenance/UpdateSearchIndexConfig.php --startOver
php path/to/extensions/CirrusSearch/maintenance/ForceSearchIndex.php
Upgrading
Please follow the upgrade instructions in the CirrusSearch UPGRADE file.
Configuration
The configuration parameters of CirrusSearch are documented at the "settings.txt" file. See also documentation on CirrusSearch configuration profiles.
$wgCirrusSearchIndexBaseName
configuration parameter, which one needs to set, e.g., $wgCirrusSearchIndexBaseName = 'mywikidatabasename';
.Hooks
CirrusSearch extension defines a number of hooks that other extensions can make use of to extend the core schema and modify documents. The following hooks are available:
- CirrusSearchAnalysisConfig - allows to hook into the configuration for analysis
- CirrusSearchMappingConfig - allows configuration of the mapping of fields
- CirrusSearchBuildDocumentParse - allows extensions to modify ElasticSearch document produced from a page
- CirrusSearchBuildDocumentLinks - allows extensions to process incoming and outgoing links for the document
- CirrusSearchBuildDocumentFinishBatch - called when a batch of pages has been indexed
- CirrusSearchAddQueryFeatures - allows extensions to add query parser features
- CirrusSearchScoreBuilder - allows extensions to define rescore builder functions
- CirrusSearchProfileService - allows extension to declare various search components and configuration
API
CirrusSearch features can be used in API queries.
Searching happens via the normal search API, action=query&list=search
; you can use CirrusSearch-specific features, such as the morelike:
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:
action=cirrusdump
module: 2014?action=cirrusdumpcirrusDumpQuery
parameter to Special:Search or search API queries: https://en.wikipedia.org/wiki/Special:Search/cat%20dog%20chicken?cirrusDumpQuerycirrusDumpResult
parameter to Special:Search or search API queries: https://en.wikipedia.org/wiki/Special:Search/cat%20dog%20chicken?cirrusDumpResult- An additional parameter,
cirrusExplain
, can be passed withcirrusDumpResult
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 valuesverbose
,pretty
orhot
, such as: https://en.wikipedia.org/wiki/Special:Search/cat%20dog%20chicken?cirrusDumpResult&cirrusExplain=pretty cirrus-config-dump
,cirrus-settings-dump
,cirrus-mapping-dump
,cirrus-profiles-dump
modules to obtain dump from the CirrusSearch setup: api.php?action=cirrus-config-dump&formatversion=2
Lihat pula
- General links
- Laman bantuan penggunaan - CirrusSearch usage documentation (needed after the install)
- Halaman proyek
- Info about Wikimedia Cirrus/Elastic setup
- Configuration help page - sets of tunable parameters that influence various aspects of the indexing
- Extension:WikiSearch - provides faceted search API for Semantic MediaWiki using ElasticSearch.
- Extension:AdvancedSearch - Enhances Special:Search by providing advanced parameters
- Pengawakutuan
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
.
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 the LocalSettings.php
file, you will want to reference the elasticsearch
as the hostname.
This will not have the WMF plugins but can be sufficient for basic testing.
Ekstensi ini sedang digunakan di salah satu atau lebih proyek Wikimedia. Ini kemungkinan berarti ekstensi ini stabil dan bekerja cukup baik untuk digunakan oleh situs web berlalu lintas tinggi. Cari nama ekstensi ini di berkas konfigurasi CommonSettings.php dan InitialiseSettings.php Wikimedia untuk melihat di mana dipasangnya. Daftar lengkap ekstensi yang dipasang di suatu wiki bisa dilihat di halaman Special:Version wiki. |
Ekstensi ini sudah termasuk dalam paket-paket dan/atau keluarga wiki berikut: Ini bukan daftar yang otoritafi. Some wiki farms/hosts and/or packages may contain this extension even if they are not listed here. Selalu periksa keluarga wiki atau bundel Anda untuk mengonfirmasi. |
- Stable extensions/id
- Search extensions/id
- API extensions/id
- Hook extensions/id
- Extensions supporting Composer/id
- GPL licensed extensions/id
- Extensions in Wikimedia version control/id
- APIAfterExecute extensions/id
- APIQuerySiteInfoGeneralInfo extensions/id
- APIQuerySiteInfoStatisticsInfo extensions/id
- ApiBeforeMain extensions/id
- ArticleRevisionVisibilitySet extensions/id
- BeforeInitialize extensions/id
- CirrusSearchAddQueryFeatures extensions/id
- CirrusSearchAnalysisConfig extensions/id
- CirrusSearchSimilarityConfig extensions/id
- GetPreferences extensions/id
- LinksUpdateComplete extensions/id
- PageDelete extensions/id
- PageDeleteComplete extensions/id
- PageMoveComplete extensions/id
- PageUndeleteComplete extensions/id
- PrefixSearchExtractNamespace extensions/id
- ResourceLoaderGetConfigVars extensions/id
- SearchGetNearMatch extensions/id
- SearchIndexFields extensions/id
- ShowSearchHitTitle extensions/id
- SoftwareInfo extensions/id
- SpecialSearchResults extensions/id
- SpecialSearchResultsAppend extensions/id
- SpecialStatsAddExtra extensions/id
- TitleMove extensions/id
- UploadComplete extensions/id
- UserGetDefaultOptions extensions/id
- All extensions/id
- Extensions requiring Composer with git/id
- Extensions used on Wikimedia/id
- Extensions included in Canasta/id
- Extensions included in Miraheze/id
- Extensions included in MyWikis/id
- Extensions included in semantic::core/id
- Extensions included in wiki.gg/id
- Extensions included in WikiForge/id
- Discovery/id
- Search/id