Personal tools
You are here: Home ブログ nagai Forrestの検索エンジンをLuceneへ変更する
Document Actions

Forrestの検索エンジンをLuceneへ変更する

今回使用したバージョンは以下のとおりです。
Forrest (Apache Forrest) 0.8


検索エンジンをLuceneへ変更します。

デフォルトではGoogleになっているsearch要素をLuceneへ変更します。Googleエンジンとは違い、domain属性は必要ありません。
name属性も必要ないようです。

skinconf.xml-------------------------------------------------------------------------------
<search provider="lucene"/>


Webアプリケーションとして起動します。

forrest siteで生成される静的サイトではなく、Webアプリケーションとしてビルドします。
組込のJettyから起動する場合はforrest webapp-local、それ以外のサーブレットコンテナから起動する場合はforrest run-webappを使用します。
※マニュアルではforrest webappとありますが、そのようなコマンドは存在しません。
※組込のJetty以外のサーブレットコンテナから起動する場合、インデックスの更新時に毎回ビルドする必要が出てしまいます。
 更新に要する時間を短くしたい場合は組込のJettyを選択する方が良いでしょう。

ビルドが完了したらプロジェクトを起動します。

検索インデックスを作成します。

このままでは検索インデックスは作成されていない為、検索しようとしても以下のようなエラーが発生します。
... lucene-index not a directory

インデックスを作成するには、以下のURLにアクセスします。インデックス付けされるファイルはxdocs配下に配置されていて、
且つsite.xmlで定義されているものです。
http://localhost:8888/lucene-update.html

遷移先のページでインデックス作成結果が表示されます。
http://localhost:8888/lucene-update.html-------------------------------------------------------------------------------
Lucene Index Creation Report
:
Index creation time breakdown

The document simple-table.xml was indexed in 93ms.

The document color-table.xml was indexed in 98ms.
:

これで検索ボックスからLuceneで検索できるようになります。
更新する際はhttp://localhost:8888/lucene-update.htmlにアクセスします。前述した通り、組込のJetty以外のサーブレット
から起動している場合は再ビルドが必要です。

The URL to Trackback this entry is:
http://dev.ariel-networks.com/Members/nagai/forrest306e691c7d2230a830f330f33092lucene3078590966f43059308b/tbping
Add comment

You can add a comment by filling out the form below. Plain text formatting.

(Required)
(Required)
(Required)
(Required)
(Required)
This helps us prevent automated spamming.
Captcha Image


Copyright(C) 2001 - 2006 Ariel Networks, Inc. All rights reserved.