您可以设置 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)。例如,“新闻文章”会变为“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 的访问权限。
- 添加可供搜索的数据源并记录其 ID。请参阅添加可供搜索的数据源。
- 对于基于 ACL 的结果,您的管理员必须创建两个身份源(一个用于 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 活动目录应用)的租户 |
| Office 365 客户端密钥 | o365.clientSecret=raHJN15vRLBKs
必需。来自 Office 365 应用设置的凭据密钥 |