LoginSignup
2

More than 5 years have passed since last update.

MacでElasticsearch(1.5.x) + Kuromojiをインストール

Last updated at Posted at 2015-11-18

Elasticsearch(1.5.x)のインストール

  1. ここからtarなどをダウンロード
  2. 好きな場所に圧縮ファイルを移動

    $ mv elasticsearch-1.5.2.tar.gz  
    $ tar xvf elasticsearch-1.5.2.tar.gz
    
  3. 実行

    $ ./elasticsearch-1.5.2/bin/elasticsearch 
    

Kuromojiプラグインのインストール

  1. プラグインのインストール 

    • Elasticsearch 1.5.xに対応しているKuromojiプラグインのversionは2.5.0
    $ ./elasticsearch-1.5.2/bin/plugin -install elasticsearch/elasticsearch-analysis-kuromoji/2.5.0
    
  2. 設定ファイルの編集

    1. elasticsearch.ymlを編集

      $ vi ./elasticsearch-1.5.2/config/elasticsearch.yml
      
    2. 以下を追加

      index.analysis.analyzer.default.type: custom
      index.analysis.analyzer.default.tokenizer: kuromoji_tokenizer
      
  3. 動作確認

$ curl -XPUT http://0.0.0.0:9200/dummy/test/1 -d '{"tag": "Elasticsearch", "text": "foo"}'
{"_index":"dummy","_type":"test","_id":"1","_version":1,"created":true}

参考

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2