建立索引的位置

配置 Solr 的第一步是建立 Lucene 索引的位置。

開始之前

這個主題的路徑名稱使用下列變數:
CLEARQUEST_HOME
Rational ClearQuest 的安裝目錄
RATIONAL_COMMON
Rational 共用檔的安裝目錄
WAS_BIN
IBM WebSphere Application Server bin 目錄:
在 Windows 上:
%RATIONAL_COMMON%\eWAS\bin
在 UNIX 系統和 Linux 上:
$RATIONAL_COMMON/eWAS/bin
yourDBName
ClearQuest 使用者資料庫的邏輯名稱
依預設,在安裝 Solr 時,會將 Lucene 索引複製到下列位置:
在 Windows 上:
%CLEARQUEST_HOME%\CQ.Solr\
在 UNIX 系統和 Linux 上:
$CLEARQUEST_HOME/CQ.Solr/

程序

  1. CQ.Solr 目錄複製到安裝 ClearQuest 全文搜尋功能的同一部電腦上 ClearQuest 安裝目錄以外的位置。建議您將 CQ.Solr 目錄複製到全文搜尋專用的快速輔助硬碟中。
  2. 重新命名 CQ.Solr\SAMPL 目錄,以對應於 ClearQuest 使用者資料庫的邏輯名稱。 例如,如果使用者資料庫名稱為 DFECT,請將 CQ.Solr\SAMPL 重新命名為 CQ.Solr\DFECT
  3. 執行 wsadmin 指令行公用程式,將「Java 虛擬機器 (JVM)」系統內容 solr.solr.home 設為 Lucene 索引的新位置:
    • 在 Windows 上:
      %WAS_BIN%\wsadmin.bat -conntype NONE -lang jython -profileName cqsearchprofile -f %WAS_BIN%\setSolrHome.py -interactive:yes drive:/CQ.Solr/yourDBName/Solr/solr
    • 在 UNIX 系統和 Linux 上:
      $WAS_BIN/wsadmin.sh -conntype NONE -lang jython -profileName cqsearchprofile -f $WAS_BIN/setSolrHome.py -interactive:yes /CQ.Solr/yourDBName/Solr/solr

    在提示您修改剛剛指定的指令行引數值時,輸入 n 指示否。將儲存配置變更。

    在啟動時,Solr 會讀取 solr.solr.home 的值,來找出其配置檔。

  4. 啟動 cqsearchprofile(Solr 所在的 WebSphere Application Server 設定檔)來啟動 Solr。
    • 在 Windows 上使用「控制台」:
      1. 按一下開始 > 控制台 > 系統管理工具 > 服務
      2. 在「服務」窗格中,用滑鼠右鍵按一下 IBM WebSphere Application Server 6.1 版 - cqsearchprofile,然後選取停止
      3. 服務停止之後,按一下滑鼠右鍵並選取啟動來重新啟動。
    • 在 Windows 上使用命令提示字元視窗:
      > net stop "IBM WebSphere Application Server V6.1 - cqsearchprofile"
      > net start "IBM WebSphere Application Server V6.1 - cqsearchprofile"
    • 在 UNIX 系統和 Linux 上:

      依據您的 UNIX 系統或 Linux 版本,新增下列其中一行至 init.d 檔案:

      $WAS_BIN/startServer.sh WebSphere-host -profileName cqsearchprofile

      $WAS_BIN/startServer.csh WebSphere-host -profileName cqsearchprofile

      如此可以確保每當系統重新啟動時,即自動啟動 cqsearchprofile

    小心: 每次變更 solr.solr.home 的值時,都必須重新啟動 cqsearchprofile

意見