您可以設定 Google Cloud Search,除了 Google Workspace 內容外,也傳回貴機構 SharePoint Online 內容的搜尋結果。使用 Cloud Search SharePoint Online 連接器,並設定該連接器來存取特定 SharePoint Online 資料來源。
重要注意事項
部署 SharePoint Online 連接器前,請注意下列事項。
系統會採用的 SharePoint 設定
連接器一律會遵守 SharePoint 的「搜尋顯示設定」。如果是草稿文件,連接器用來存取 SharePoint Online 的使用者帳戶權限,會控管連接器建立索引及傳回的草稿文件。如果帳戶只有「完整讀取」權限,連接器會遵守「草稿項目顯示設定」。
您也可以設定連結器,根據使用者帳戶存取權限制結果。 如要套用安全性修剪功能,請將這些外部身分與 Google Cloud Directory 同步:
- Office 365 / Azure AD 使用者。
- Office 365 / Azure AD 安全性群組。
- SharePoint 群組 (成員為 Office 365 使用者和群組)。
搜尋最佳化
設定連結器,傳回相關結果,提升搜尋體驗。在設定檔中使用 HTML 生成參數,設定欄位影響層級。
如要設定結構定義,請參閱「建立及註冊結構定義」。設定結構定義時:
- 連接器會將 SharePoint 內容類型正規化為有效的物件定義名稱 (A-Z、a-z、0-9)。例如,「News Article」會變成「NewsArticle」。
- 如果連接器無法比對物件定義,就會使用備用物件類型 (
itemMetadata.objectType)。請參閱「中繼資料設定參數」。 - 連接器會將 SharePoint 屬性名稱對應至屬性定義。
- 連接器會覆寫 Microsoft Outlook
.msg檔案的媒體類型,並將這些檔案編入application/vnd.ms-outlook索引。
已知的連結器限制
- 每個連結器執行個體只會為單一網站集合建立索引。 如要為多個網站集合建立索引,請設定其他執行個體。
- ACL 中的不重複使用者和群組越多,記憶體消耗量就越高。
- 刪除通知最多可能需要 4 小時才能生效。
系統需求
| 系統需求 | |
|---|---|
| 作業系統 | Windows Server 2016、Ubuntu、Red Hat Enterprise Linux 5.0 或 SUSE Enterprise Linux 10 (64 位元)。 |
| 驗證 | 即時驗證。 |
| 軟體 | SharePoint Online 環境;Java JRE 1.8。 |
部署連接器
請按照下列步驟部署 SharePoint Online 連接器。
必要條件
- 建立 Google Workspace 私密金鑰。請參閱「設定 Cloud Search API 的存取權」。
- 在 Cloud Search 中新增資料來源,並記錄其 ID。請參閱「在搜尋功能中新增資料來源」。
- 如要取得以存取控制清單為依據的結果,管理員必須建立兩個身分來源 (一個用於 Office 365,另一個用於 SharePoint 群組),並提供 Google Workspace 客戶 ID。請參閱「對應使用者識別資訊」。
- 為連接器設定使用者帳戶,並授予 SharePoint Online 網站集合管理員權限。
- 建立具有
Group.Read.All和User.Read.All權限的 Azure Active Directory 應用程式憑證。記下應用程式 ID、租戶和用戶端密鑰。
步驟 1:安裝連接器軟體
- 複製存放區:
$ git clone https://github.com/google-cloudsearch/sharepoint-connector.git $ cd sharepoint-connector
- 查看所選版本 (例如
v1-0.0.3):$ git checkout tags/v1-0.0.3
- 建構連接器:
如要略過測試,請使用$ mvn package
mvn package -DskipTests。 - 將 ZIP 檔案解壓縮至安裝目錄。
步驟 2:建立設定檔
在安裝目錄中建立 sharepoint-online-connector.config。以鍵/值組合形式新增參數,如下列範例所示:
api.sourceId=08ef8becd116faa4546b8ca2c84b2879
api.serviceAccountPrivateKeyFile=service_account.json
sharepoint.server=https://mydomain.onmicrosoft.com
sharepoint.siteCollectionOnly=true
sharepoint.username=admin@mydomain.onmicrosoft.com
sharepoint.password=password
sharepoint.formsAuthenticationMode=LIVE
sharepoint.deploymentType=ONLINE
api.identitySourceId=08ef8becd116faa475de26d9b291fed9
api.referenceIdentitySources=defaultIdentitySource
api.referenceIdentitySource.defaultIdentitySource.id=08ef8becd116faa5d3783f8c5a80e5aa
詳情請參閱參考資料或「Google 提供的參數」。
步驟 3:設定記錄功能
建立 logs 資料夾和 logging.properties 檔案,並加入以下內容:
handlers = java.util.logging.ConsoleHandler,java.util.logging.FileHandler
# Default log level
.level = INFO
# uncomment line below to increase logging level for SharePoint APIsa
#com.google.enterprise.cloudsearch.sharepoint.level=FINE
# uncomment line below to increase logging level to enable API trace
#com.google.api.client.http.level = FINE
java.util.logging.ConsoleHandler.level = INFO
java.util.logging.FileHandler.pattern=logs/connector-sharepoint.%g.log
java.util.logging.FileHandler.limit=10485760
java.util.logging.FileHandler.count=10
java.util.logging.FileHandler.formatter=java.util.logging.SimpleFormatter
步驟 4:設定 SharePoint 身分識別連接器
如要套用以身分為依據的 ACL,請使用 api.customerId 和其他連線參數建立 sharepoint-online-identity-connector.config,如下列範例所示:
```properties
### SharePoint Online identity connector configuration ###
# Required parameters for data source access
api.customerId=C05d3djk8
api.serviceAccountPrivateKeyFile=service_account.json
# Required parameters for SharePoint Online access
sharepoint.server=https://mydomain.onmicrosoft.com
sharepoint.siteCollectionOnly=true
sharepoint.username=admin@mydomain.onmicrosoft.com
sharepoint.password=pa$sw0rd
sharepoint.formsAuthenticationMode=LIVE
sharepoint.deploymentType=ONLINE
# SharePoint identity mapping parameters
api.identitySourceId=08ef8becd116faa475de26d9b291fed9
api.referenceIdentitySources=defaultIdentitySource
api.referenceIdentitySource.defaultIdentitySource.id=08ef8becd116faa5d3783f8c5a80e5aa
```
步驟 5:安裝 Office 365 識別資訊連接器
如果您使用 SharePoint Online 身分型 ACL,請執行這個步驟。 如果您使用公開 ACL,請略過這個步驟。
複製 Office 365 存放區:
$ git clone https://github.com/google-cloudsearch/office-365-connector.git $ cd office-365-connector使用
mvn package查看並建構連接器。將 ZIP 檔案解壓縮至安裝目錄。
步驟 6:設定 Office 365 身分識別連接器
在身分識別連接器安裝目錄中,建立名為
o365-identity-connector.config的檔案,並以鍵/值組合形式新增參數:### Office 365 Identity connector configuration ### api.identitySourceId=<var>12345abcde</var> api.customerId=<var>abcde12345</var> o365.clientId=<var>a63c6eb3-29e7-486</var> o365.tenant=<var>185ef9ed-29e7-486</var> o365.clientSecret=<var>raHJN15vRLBKs</var>如需參數說明,請參閱「Office 365 身分識別連接器」。
在同一個目錄中,建立名為
logs的資料夾。在同一個目錄中建立名為
logging.properties的檔案,並在當中加入下列內容:handlers = java.util.logging.ConsoleHandler,java.util.logging.FileHandler # Default log level .level = INFO # uncomment line below to increase logging level for Office 365 APIs #com.google.enterprise.cloudsearch.o365.level=FINE # uncomment line below to increase logging level to enable Google API traces #com.google.api.client.http.level = FINE java.util.logging.ConsoleHandler.level = INFO java.util.logging.FileHandler.pattern=logs/connector-o365.%g.log java.util.logging.FileHandler.limit=10485760 java.util.logging.FileHandler.count=10 java.util.logging.FileHandler.formatter=java.util.logging.SimpleFormatter
步驟 7:啟動連接器
設定連接器後,請執行連接器,開始同步處理及建立索引。在各自的終端機視窗中執行每個指令。
執行 Office 365 身分識別連接器,同步處理使用者和群組:
$ java -Djava.util.logging.config.file=logging.properties -jar google-cloudsearch-office-365-connector-v1-0.0.3.jar -Dconfig=o365-identity-connector.config執行 SharePoint Online 身分識別連接器,同步處理網站集合群組:
$ java -Djava.util.logging.config.file=logging.properties -jar google-cloudsearch-sharepoint-connector-v1-0.0.3.jar -Dconfig=sharepoint-online-identity-connector.config執行 SharePoint Online 連接器,為內容建立索引:
$ java -Djava.util.logging.config.file=logging.properties -jar google-cloudsearch-sharepoint-connector-v1-0.0.3.jar -Dconfig=sharepoint-online-connector.config
設定參數參考資料
下列各節列出用於設定 SharePoint Online 連接器的設定參數。
資料來源存取權
| 設定 | 參數 |
| 資料來源 ID | api.sourceId=1234567890abcdef
必填。Google Workspace 管理員設定的 Google Cloud Search 資料來源 ID。 |
| 服務帳戶私密金鑰檔案的路徑 | api.serviceAccountPrivateKeyFile=PrivateKey.json
必填。Google Cloud Search 服務帳戶金鑰檔案的路徑。 |
SharePoint Online 存取權
| 設定 | 參數 |
| SharePoint 網站集合的完整網域名稱 | sharepoint.server=http://yoursharepoint.example.com/
必填。如果網域名稱不完整,請在連接器主機上設定 DNS 覆寫。 |
| 僅限網站集合模式 | sharepoint.siteCollectionOnly=true
必填。如果是 SharePoint Online,請將值設為 |
| SharePoint 使用者名稱 | sharepoint.username=username
必填。用來存取 SharePoint Online 的帳戶使用者名稱。 |
| SharePoint 密碼 | sharepoint.password=user_password
必填。用來存取 SharePoint Online 的帳戶密碼。 |
| 驗證模式 | sharepoint.formsAuthenticationMode=LIVE
必填。如果是 SharePoint Online,值一律為 `LIVE`。 |
| 部署作業類型 | sharepoint.deploymentType=ONLINE
必填。如果是 SharePoint Online,值一律為 `ONLINE`。 |
SharePoint 識別資訊對應
| 設定 | 參數 |
| 識別資訊來源 ID | api.identitySourceId=1234567890abcdef
必填。SharePoint 群組識別資訊來源的 Cloud Search 識別資訊來源 ID。 |
| 參考識別資訊來源 | api.referenceIdentitySources=defaultIdentitySource
必填。如果是 SharePoint Online,值一律為 `defaultIdentitySource`。 |
| 參考識別資訊來源 ID | api.referenceIdentitySource.defaultIdentitySource.id=112233abcd
必填。Office 365 使用者和群組識別資訊來源的 Cloud Search 識別資訊來源 ID。 |
生成 HTML 內容
| 設定 | 參數 |
| HTML 範本標題欄位 | contentTemplate.sharePointItem.title=Title
要用做所產生 HTML 的 HTML 範本標題的 SharePoint 欄位。 |
| HTML 內容高搜尋品質欄位 | contentTemplate.sharePointItem.quality.high=highField1[,highField2,...]
以半形逗號分隔的欄位清單,這些欄位會以高品質欄位形式納入產生的 HTML 中。如果搜尋查詢字詞與這些欄位相符,結果排名就會較高。 |
| HTML 內容中等搜尋品質欄位 | contentTemplate.sharePointItem.quality.medium=mediumField1[,mediumField2,...]
以半形逗號分隔的欄位清單,這些欄位會以中等品質欄位形式納入產生的 HTML 中。 |
| HTML 內容低搜尋品質欄位 | contentTemplate.sharePointItem.quality.low=lowField1[,lowField2,...]
以半形逗號分隔的欄位清單,這些欄位會以低品質欄位形式納入產生的 HTML 中。 |
| HTML 內容未對應的資料欄 | contentTemplate.sharepointItem.unmappedColumnsMode=APPEND
連接器處理未對應資料欄的方式。值為 APPEND (預設) 或 IGNORE。
|
設定 Office 365 身分識別連接器
| 設定 | 參數 |
| 識別資訊來源 ID | api.identitySourceId=1234567890abcdef
必填。Office 365 識別資訊來源 ID。這個值應與 SharePoint Online 連接器設定中的 `api.referenceIdentitySource.defaultIdentitySource.id` 值相符。 |
| Google 客戶 ID | api.customerId=c1b1d1e1
必填。貴機構的 Google Workspace 客戶 ID。 |
| Office 365 應用程式 ID | o365.clientId=a63c6eb3-29e7-486
必填。Office 365 應用程式設定中的應用程式 ID。 |
| Office 365 租戶 | o365.tenant=185ef9ed-29e7-486
必填。Office 365 帳戶的租戶 (Azure Active Directory 應用程式) |
| Office 365 用戶端密鑰 | o365.clientSecret=raHJN15vRLBKs
必填。Office 365 應用程式設定中的憑證密鑰 |