編集の要約なし
編集の要約なし |
編集の要約なし |
||
8行目: | 8行目: | ||
*yumリポジトリの確認 | *yumリポジトリの確認 | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash" line start="100"> | ||
vi /etc/yum.repos.d/elasticsearch.repo | vi /etc/yum.repos.d/elasticsearch.repo | ||
[elasticsearch-6.x] | [elasticsearch-6.x] | ||
73行目: | 73行目: | ||
*Indexの作成 | *Indexの作成 | ||
上記Extensionsをインストールする過程で、LocalSettings.phpに以下の設定を追加する。 | 上記Extensionsをインストールする過程で、LocalSettings.phpに以下の設定を追加する。 | ||
<syntaxhighlight lang=" | <syntaxhighlight lang="php"> | ||
Add this to LocalSettings.php: | Add this to LocalSettings.php: | ||
require_once( "$IP/extensions/Elastica/Elastica.php" ); | require_once( "$IP/extensions/Elastica/Elastica.php" ); | ||
81行目: | 81行目: | ||
*設定を保存したら、以下のコマンドを実行し、実行後、$wgDisableSearchUpdate = true;を削除する。 | *設定を保存したら、以下のコマンドを実行し、実行後、$wgDisableSearchUpdate = true;を削除する。 | ||
<syntaxhighlight lang=" | <syntaxhighlight lang="php"> | ||
Now run this script to generate your elasticsearch index: | Now run this script to generate your elasticsearch index: | ||
php $MW_INSTALL_PATH/extensions/CirrusSearch/maintenance/updateSearchIndexConfig.php | php $MW_INSTALL_PATH/extensions/CirrusSearch/maintenance/updateSearchIndexConfig.php | ||
87行目: | 87行目: | ||
*次に、以下のコマンドを実行し、実行後、$wgSearchType = 'CirrusSearch';をLocalSettings.phpへ追加する。 | *次に、以下のコマンドを実行し、実行後、$wgSearchType = 'CirrusSearch';をLocalSettings.phpへ追加する。 | ||
<syntaxhighlight lang=" | <syntaxhighlight lang="php"> | ||
php $MW_INSTALL_PATH/extensions/CirrusSearch/maintenance/forceSearchIndex.php --skipLinks --indexOnSkip | php $MW_INSTALL_PATH/extensions/CirrusSearch/maintenance/forceSearchIndex.php --skipLinks --indexOnSkip | ||
php $MW_INSTALL_PATH/extensions/CirrusSearch/maintenance/forceSearchIndex.php --skipParse | php $MW_INSTALL_PATH/extensions/CirrusSearch/maintenance/forceSearchIndex.php --skipParse | ||
107行目: | 107行目: | ||
*analyzer設定の変更 | *analyzer設定の変更 | ||
:src/elasticsearch/Indexer.phpの'analyzer' => 'english'を'kuromoji'へ変更する。この変更はプラグインがバージョンアップされたらリセットされるため注意が必要。 | :src/elasticsearch/Indexer.phpの'analyzer' => 'english'を'kuromoji'へ変更する。この変更はプラグインがバージョンアップされたらリセットされるため注意が必要。 | ||
<syntaxhighlight lang=" | <syntaxhighlight lang="php" line start="100"> | ||
if($props['type'] == 'string' && $props['index'] == 'analyzed'){ | if($props['type'] == 'string' && $props['index'] == 'analyzed'){ | ||
$lang = Config::apply_filters('string_language', 'english'); | $lang = Config::apply_filters('string_language', 'english'); | ||
124行目: | 124行目: | ||
Fantastic Elasticsearchが古いバージョンの場合 | Fantastic Elasticsearchが古いバージョンの場合 | ||
<syntaxhighlight lang=" | <syntaxhighlight lang="php" line start="100"> | ||
if($props['type'] == 'string' && $props['index'] == 'analyzed'){ | if($props['type'] == 'string' && $props['index'] == 'analyzed'){ | ||
$props = array( | $props = array( |