
Apache Solr (1)
Wikipedia(https://ja.wikipedia.org/wiki/Apache_Solr)より
Solr(ソーラー)は、オープンソースの全文検索システム。Apacheソフトウェア財団のLuceneプロジェクトのサブプロジェクトとして開発されている。
今回は Apache Solr を使ってみます。 まずは「DOWNLOAD」から取得します。
案内に従い、山形大学のミラーから取得しました。 形式は zip や tgz などから選べます。
展開後、solr-x.x.x/example/README.txt を確認します。
上記にある"dih"(Data Import Handler) を試してみます。 solr-x.x.x上にいるとしてbin/solr -e dihを実行します。
*** [WARN] *** Your open file limit is currently 256.
It should be set to 65000 to avoid operational disruption.
If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh
*** [WARN] *** Your Max Processes Limit is currently 709.
It should be set to 65000 to avoid operational disruption.
If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh
Starting up Solr on port 8983 using command:
"bin/solr" start -p 8983 -s "example/example-DIH/solr"
*** [WARN] *** Your open file limit is currently 10240.
It should be set to 65000 to avoid operational disruption.
If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh
*** [WARN] *** Your Max Processes Limit is currently 709.
It should be set to 65000 to avoid operational disruption.
If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh
Waiting up to 180 seconds to see Solr running on port 8983 [-]
Started Solr server on port 8983 (pid=97580). Happy searching!
Solr dih example launched successfully. Direct your Web browser to http://localhost:8983/solr to visit the Solr Admin UI警告が何度か出ていますが、ひとまずここは置いておいて、示された"Solr Admin UI"を確認します。
初期画面は"Dashboard"です。早速データを取り込んでみます。
データの種別(左側メニューのコンボボックス)を選択すると、その下にさらにメニューが表示されます。 ここでは、"atom" -> "DataImport"と選択しています。 さらにEntityを選択(exampleでは"stackoverflow"のみ)した後、"Execute"を押下します。
"Refresh Status"を押下すると、右側にステータスが表示されます。 
クエリを発行してみます。
初期状態では JSON 形式で出力されるようです。 wtの値を変えれば、出力形式を変えられます。
XML や
Python 形式にも切り替えられました。
次はもう少し実用的なデータで試してみたいと思います。
share