LoginSignup
12
11

More than 5 years have passed since last update.

Lucene 5.0 に対応した Apache Solr 5.0 がリリースされてた

Last updated at Posted at 2015-02-23

ので見てみた

更新内容はこちらから。

Solr:

Lucene:

雑感

検索機能的な意味ででかいのは DateRangeField が追加され、ファセット検索が利用できるようになったことだろうか。REST APIによるダイナミックフィールドとフィールドタイプの追加削除もできるようになってる。

地味に嬉しい installスクリプトの改善。

あと、座標インデックスの距離の単位指定 units ではなく distanceUnits になり、デフォルトはキロメートルだが degrees (度)に変更することができる。

けっこうダイナミックにクラス類やパラメータの名称変更や削除が行われている。Solr 4.x からの移行はそれなりに気を使うかもしれない。

その他、NOTEに記述があるがSolrCloud のコレクションの追加削除がAPI経由でしか利用できなくなっている。

直接起動で試す

いつものように素の動作を確認します。

動作確認環境はGoogle Compute Engine 上の CentOS7 サーバ。VM構築直後の状態から。必要なのはとりあえず jdk のみ。

[~]$ curl -O http://ftp.riken.jp/net/apache/lucene/solr/5.0.0/solr-5.0.0.tgz
[~]$ sudo yum install -y java-1.7.0-openjdk java-1.7.0-openjdk-devel
[~]$ tar xzvf solr-5.0.0.tgz
[~]$ cd solr-5.0.0
[solr-5.0.0]$ ./bin/solr status

No Solr nodes are running.

[solr-5.0.0]$ ./bin/solr start

Started Solr server on port 8983 (pid=). Happy searching!

起動したよ!!!(コアが一つもないからとりあえず何もできないけど)

[solr-5.0.0]$ curl 'http://localhost:8983/solr/admin/cores?action=STATUS&wt=json'
{"responseHeader":{"status":0,"QTime":0},"initFailures":{},"status":{}}

サービスをインストールする

Solr 3 からの移行組である僕は install_solr_service.sh がちゃんとやってくれる感に涙しました。

[solr-5.0.0]$ sudo ./bin/install_solr_service.sh ~/solr-5.0.0.tgz
id: solr: no such user
Creating new user: solr
Extracting /home/ma2saka/solr-5.0.0.tgz to /opt
Creating /etc/init.d/solr script ...

Started Solr server on port 8983 (pid=2257). Happy searching!


Found 1 Solr nodes:

Solr process 2257 running on port 8983
WARN  - 2015-02-23 04:12:21.172; org.apache.solr.util.SolrCLI; Request to http://localhost:8983/solr/admin/info/system failed due to: Connection refused, sleeping for 5 seconds before re-trying the request ...
{
  "solr_home":"/var/solr/data/",
  "version":"5.0.0 1659987 - anshumgupta - 2015-02-15 12:26:10",
  "startTime":"2015-02-23T04:12:11.898Z",
  "uptime":"0 days, 0 hours, 0 minutes, 14 seconds",
  "memory":"29.9 MB (%6.1) of 490.7 MB"}

Service solr installed.

この直後、solrが /etc/init.d/solr によって起動していたので、一度 service コマンドで止めて、

[solr-5.0.0]$ sudo /etc/init.d/solr status

Found 1 Solr nodes:

Solr process 2257 running on port 8983
{
  "solr_home":"/var/solr/data/",
  "version":"5.0.0 1659987 - anshumgupta - 2015-02-15 12:26:10",
  "startTime":"2015-02-23T04:12:11.898Z",
  "uptime":"0 days, 0 hours, 2 minutes, 10 seconds",
  "memory":"32.2 MB (%6.6) of 490.7 MB"}

[solr-5.0.0]$ sudo /etc/init.d/solr stop
Sending stop command to Solr running on port 8983 ... waiting 5 seconds to allow Jetty process 2257 to stop gracefully.

改めて systemctl コマンドで起動し直す。

[solr-5.0.0]$ sudo systemctl start solr
[solr-5.0.0]$ sudo systemctl status solr
solr.service - LSB: Controls Apache Solr as a Service
   Loaded: loaded (/etc/rc.d/init.d/solr)
   Active: active (exited) since 月 2015-02-23 04:14:37 UTC; 5s ago
  Process: 2619 ExecStart=/etc/rc.d/init.d/solr start (code=exited, status=0/SUCCESS)

 2月 23 04:14:37 solr50-test01 systemd[1]: Starting LSB: Controls Apache Solr as a Service...
 2月 23 04:14:37 solr50-test01 su[2621]: (to solr) root on none
 2月 23 04:14:37 solr50-test01 solr[2619]: Started Solr server on port 8983 (pid=2676). ...ng!
 2月 23 04:14:37 solr50-test01 systemd[1]: Started LSB: Controls Apache Solr as a Service.
Hint: Some lines were ellipsized, use -l to show in full.

よしよしいい感じ。インストーラがちゃんとサービスを登録してくれると気持ちがいいですね。

12
11
0

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
12
11