對 SAMPL 資料庫啟用全文搜尋

對預設 ClearQuest SAMPL 資料庫啟用全文搜尋,以瞭解配置此特性及其功能。

開始之前

此實務範例大約需要 15 分鐘才能完成,因為 SAMPL 資料庫有較少的記錄。

關於這項作業

此實務範例搭配使用綱目儲存庫與名稱為 TextSearch 的連線以及名稱為 SAMPL 的使用者資料庫。 路徑規格假設您是在 Windows 作業系統上執行。如果您是在 UNIX 系統或 Linux 上執行,請進行適當的替代。

程序

  1. 在命令提示字元視窗中,搭配執行 cqtsadmin.pl 指令與 init_cq_ftscreate_fts_was_profile 選項:

    cqperl cqtsadmin.pl --username admin --password secret --dbset TextSearch --userdb SAMPL --ftshome D:\CQ.Search --init_cq_fts --create_fts_was_profile automatic --fts_was_profile_home D:\CQFTS.WASprofiles

    此指令完成時,與您綱目對應的配置資料會放在下列目錄中:D:\CQ.Search\TextSearch_SAMPL\
  2. 編輯與部署相關聯的實體檔案:D:\CQ.Search\TextSearch_SAMPL\Entity-TextSearch-SAMPL.txt。 針對每一種記錄類型,選取要在全文搜尋結果中顯示的顯示欄位,方法是在前面附加 & 符號。例如,將下列內容:
    Customer=Attachment,CallTrackingID,Name,Phone,...
    Defect=Attachments,Description,Headline,Keywords,...
    Email_Rule=Action_types,Actions,Name,Operator_Value,...
    Project=Description,Name,dbid,...
    變更為:
    Customer=Attachment,CallTrackingID,&Name,Phone,...
    Defect=Attachments,Description,&Headline,Keywords,...
    Email_Rule=Action_types,Actions,&Name,Operator_Value,...
    Project=Description,&Name,dbid,...
    您不需要為每一種記錄類型選取一個顯示欄位。不過,如果您未選取,則會使用 dbid 欄位作為預設顯示欄位(可能不適用於搜尋結果)。請注意,您一律可於稍後變更顯示欄位,而不需要重新編製資料的索引。如需詳細資料,請參閱變更索引記錄類型的顯示欄位
    重要: 當您在正式作業資料庫上設定全文搜尋時,除了選取顯示欄位之外,您還必須選取要編製索引的記錄類型及關聯的欄位。 例如,如果您不想編製 Email_Rule 記錄類型的索引,請從清單中刪除它。若只要針對 Customer 記錄類型編製 NamePhone 欄位的索引,請刪除其他欄位。
  3. 編輯 D:\CQ.Search\TextSearch_SAMPL\cqtsadmin-TextSearch-SAMPL.xml 配置檔。
    1. <updateIndexDelay> 標籤的值從:
      <newValue required="no"></newValue>

      變更為:

      <newValue required="no">60</newValue>

      這會將更新模式索引延遲的預設值從 10 分鐘(600 秒)變更為 60 秒,表示它大約需要 60 秒的時間,讓您對記錄進行的變更出現在全文搜尋結果集中。

    2. 選用項目:<updateIndexLoginInterval> 標籤的值從:
      <newValue required="no"></newValue>

      變更為:

      <newValue required="no">10</newValue>

      這會將發出 ClearQuest 帳戶重新登入之前的更新模式記錄擷取週期數目從預設值 1 變更為 10。

  4. 再次搭配執行 cqtsadmin.pl 指令與 setup_cq_fts 選項,以完成部署:

    cqperl cqtsadmin.pl --username admin --password secret --dbset TextSearch --userdb SAMPL --ftshome D:\CQ.Search --setup_cq_fts

    重要: 在正式作業環境中,ClearQuest Web 用戶端使用者可以在批次模式索引期間使用全文搜尋。不過,在編製索引完成之前,結果並不完整。
  5. UNIX 系統及 Linux:如果您是在 UNIX 系統或 Linux 上執行,請驗證下列指令是作為啟動常駐程式的一部分來執行,以確保在重新啟動系統時自動啟動 Solr 及記錄檢索程式:
    fts-was-profile-home/profile-name/bin/startServer.sh
    其中,變數為:
    fts-was-profile-home
    進行全文搜尋的 WebSphere Application Server 設定檔所在的目錄
    profile-name
    進行全文搜尋特性的 WebSphere Application Server 設定檔的名稱
    例如:
    /opt/CQFTS.WASprofiles/cqfts_TextSearch_SAMPL/bin/startServer.sh server1 -profileName cqfts_TextSearch_SAMPL

結果

您已對 SAMPL 資料庫啟用全文搜尋。


意見