部署 Microsoft SharePoint On-premises 連接器

您可以設定 Google Cloud Search,除了 Google Workspace 內容外,也從貴機構的 SharePoint 內部部署內容傳回結果。使用 Cloud Search SharePoint On-premises 連接器,並設定該連接器來存取特定 SharePoint 資料來源。

重要注意事項

部署 SharePoint On-premises 連接器前,請注意下列事項。

系統會採用的 SharePoint 設定

連接器一律會遵守 SharePoint 的「搜尋顯示設定」。 如果是草稿文件,連接器用來存取 SharePoint 的使用者帳戶權限,會控管連接器建立索引及傳回的文件。如果帳戶具備「完整讀取」權限,連接器會遵守「草稿項目顯示設定」。

您也可以使用 Google 和外部主體定義 ACL,根據使用者帳戶存取權限制結果。如要套用安全性修剪功能,請將這些外部身分與 Google Cloud Directory 同步:

  • Active Directory 使用者和群組。
  • SharePoint 本機群組 (成員為 Active Directory 使用者和群組)。

如要同步處理 AD 使用者和群組,請使用 Google Cloud Directory Sync,並啟用身分對應群組。如為 SharePoint 本機群組,請使用 SharePoint 身分識別連接器。

連接器也會執行 Active Directory 查詢,擷取要同步處理主體的資訊,例如將 SID 對應至 sAMAccountName。

搜尋最佳化

設定連結器,傳回相關結果,提升搜尋體驗。在設定檔中使用 HTML 生成參數,設定欄位影響層級。

如要設定結構定義,請參閱「建立及註冊結構定義」。設定結構定義時:

  • 連接器會將 SharePoint 內容類型正規化為有效的物件定義名稱 (A-Z、a-z、0-9)。例如,「News Article」會變成「NewsArticle」。
  • 如果連接器無法比對物件定義,就會使用備用物件類型 (itemMetadata.objectType)。請參閱「中繼資料設定參數」。
  • 連接器會解碼十六進位字元,並移除「ows_」前置字元,藉此正規化屬性名稱。

Microsoft Outlook 郵件處理

連接器會覆寫 Microsoft Outlook .msg 檔案的媒體類型,並將其編入 application/vnd.ms-outlook 索引。

多租戶設定

如果是多租戶部署,請設定網站集合模式:

  • 授予連接器帳戶「網站集合管理員」權限。
  • sharepoint.server 設為網站集合網址 (例如 http://sharepoint.example.com/sites/collection)。
  • sharepoint.siteCollectionOnly 設為 true

每個網站集合設定一個連接器執行個體。

已知限制

  • 受監控的資料庫越多,偵測變更所需的時間就越長。
  • ACL 中的不重複使用者和群組越多,記憶體用量就越高。
  • 連接器僅支援來自單一 Active Directory 網域的身分。
  • 刪除通知可能需要超過四小時才會生效。

系統需求

系統需求
作業系統 Windows Server 2016、Ubuntu、Red Hat Enterprise Linux 5.0 或 SUSE Enterprise Linux 10 (64 位元)。
軟體 SharePoint Server 2013 或 2016;Java JRE 1.8。
驗證 NTLM、Kerberos、HTTP Basic 或 ADFS。

部署連接器

請按照下列步驟部署 SharePoint On-premises 連接器。

必要條件

  1. 建立 Google Workspace 私密金鑰。請參閱「設定 Cloud Search API 的存取權」。
  2. 在 Cloud Search 中新增資料來源,並記錄其 ID。請參閱「在搜尋功能中新增資料來源」。
  3. 如要取得 ACL 相關結果,管理員必須建立兩個身分識別來源 (一個用於 Active Directory,另一個用於 SharePoint 本機群組),並提供 Google Workspace 客戶 ID。請參閱「對應使用者識別資訊」。
  4. 為連接器設定具備「完整讀取」權限的使用者帳戶。
  5. 確認 SharePoint 網頁應用程式具有根網站集合。
  6. 如果網站集合已寫入鎖定,請執行 PrepareWriteLockedSites.ps1 指令碼。

步驟 1:安裝連接器軟體

  1. 複製存放區:
    $ git clone https://github.com/google-cloudsearch/sharepoint-connector.git
    $ cd sharepoint-connector
  2. 查看所選版本 (例如 v1-0.0.5):
    $ git checkout tags/v1-0.0.5
  3. 建構連接器:
    $ mvn package
    如要略過測試,請使用 mvn package -DskipTests
  4. 將 ZIP 檔案解壓縮至安裝目錄。

步驟 2:建立設定檔

在安裝目錄中建立 connector-config.properties。以鍵/值組合形式新增參數:

api.sourceId=08ef8becd116faa4546b8ca2c84b2879
api.serviceAccountPrivateKeyFile=service_account.json
api.identitySourceId=08ef8becd116faa475de26d9b291fed9
sharepoint.server=http://sp-2016:32967/sites/collection
sharepoint.siteCollectionOnly=true
sharepoint.username=contoso\\admin
sharepoint.password=password
adLookup.host=dc.contoso.com
adLookup.username=contoso\\admin
adLookup.password=password

詳情請參閱參考資料或「Google 提供的參數」。

步驟 3:將 SharePoint 新增為信任的主機 (HTTPS)

如果使用 HTTPS,請匯出 SharePoint 憑證,然後匯入連接器的金鑰儲存區:

$ keytool -importcert -keystore cacerts.jks -storepass changeit -file sharepoint.crt -alias sharepoint

步驟 4:設定記錄功能

建立 logs 資料夾和 logging.properties 檔案,並加入以下內容: properties handlers = java.util.logging.ConsoleHandler,java.util.logging.FileHandler .level = INFO java.util.logging.ConsoleHandler.level = INFO java.util.logging.FileHandler.pattern=logs/connector-sharepoint.%g.log

步驟 5:設定身分識別連接器

如要套用以身分為依據的 ACL,請使用 api.customerId 和其他連線參數建立 sharepoint-onprem-identity-connector.config

步驟 6:啟動連接器

  1. 執行 GCDS,同步處理 Active Directory 使用者和群組。
  2. 執行 SharePoint 身分識別連接器,同步處理網站集合群組。
  3. 執行 SharePoint On-premises 連接器,為內容建立索引。

設定參數參考資料

以下各節列出用於設定 SharePoint On-premises 連接器的設定參數。

資料來源存取權

設定 參數
資料來源 ID api.sourceId=ID
服務帳戶 api.serviceAccountPrivateKeyFile=path

SharePoint 內部部署存取權

設定 參數
伺服器網址 sharepoint.server=URL
憑證 sharepoint.usernamesharepoint.password

生成 HTML 內容

設定 參數
標題欄位 contentTemplate.sharePointItem.title=Title
品質欄位 contentTemplate.sharePointItem.quality.highmediumlow