配置知识文章架构映射

备注

功能可用性信息如下。

Dynamics 365 Contact Center—嵌入 Dynamics 365 Contact Center—独立 Dynamics 365 Customer Service
否​

在 Customer Service 中添加集成式搜索提供程序的过程中,您需要告诉服务如何引入从提供程序收到的知识文章。 通过选择和配置知识文章架构来实现此目的。 保存配置后,无法更改架构。

如果在身份验证和测试部分应用了语言筛选器,必须在 JSON 架构知识文章架构映射部分维护语言区域设置的映射。 有关语言区域设置值的详细信息,请转到:语言 (LanguageLocale) 表/实体参考

知识文章架构部分选择一个选项:

字段映射

选择并上载用于元数据选择的文件,然后选择要在映射中使用的元标记。 使用字段映射,根据操作类型将从搜索提供程序(源属性)收到的知识文章映射到知识文章实体(目标)的属性。

选择并上载用于元数据选择的文件

  1. 将文章本地保存为网页,仅 HTML 文件。 确保文件名小于 99 个字符。

  2. 在 Customer Service 管理中心或 Contact Center 管理中心站点地图中,在知识文章架构>字段映射部分,选择选择文件来上载文件。

    在 HTML 文件中找到的所有元标记都会列在元标记设置部分。

  3. 选择选择下方的所有元标记或只选择需要映射的元标记。

    您在此处选择的元标记将成为您可以在映射部分选择为源属性的属性。 如果不选择任何属性,只有默认的源属性 HTML-TitleHTML-Body 可以映射。

  4. 要转到映射部分,选择下一步。 如果要停止,之后再返回,选择另存为草稿

映射文章属性

使用操作类型将源属性映射到目标。

  • 文章属性:知识文章目标字段值。
  • 操作类型:将源文章映射到知识文章实体的文章属性的映射模式。 详细了解操作类型映射选项。
  • 源属性:您为每种操作类型定义的值。 例如,如果选择直接操作类型,则必须从先前选择的元标记或 HTML-Title 标记中选择。
  1. 在 Customer Service 管理中心或 Contact Center 管理中心站点地图的映射部分,必需的知识文章属性为内容外部参考 Id标题。 对于每个属性,选择操作类型源属性

    确保外部引用 ID 值是唯一的。

  2. 要添加更多文章属性,选择添加行,然后选择文章属性操作类型源属性

    如果需要,您还可以选择删除删除文章属性。

  3. 选择验证映射

    此服务使用您输入的值来根据您上载的 HTML 文件确定属性的值。 它验证映射表和 Regex 模式中的条目。 不会对 RegexUrl 进行验证。

    如果验证成功,将显示确认消息。 如果验证失败,将显示错误消息。 根据错误消息,检查映射表中的条目或您输入的 Regex 模式。

  4. 选择下一步前往下一节。 如果要停止,之后再返回,选择另存为草稿

操作类型映射选项

从以下操作类型映射选项中进行选择:

  • Regex:使用 regex 模式从源网站提取值。 源属性是一个文本字段,您可以在其中输入 regex 模式。 与此模式匹配的网站 HTML 中的字符串将映射到相应的知识文章字段。

    Regex 模式必须有一个用括号括起来的捕获组,以允许您提取匹配文本的特定部分。 此文本从第一个匹配的第一个非空组中提取。

    以下是从特定 div 标记中提取内容的 Regex 模式的一些示例:

    • 基于 div 标记 ID:<div\b[^>]*id=\"your-id-name-here\"[^>]*>([\s\S]*?)<\/div>
    • 基于 div 标记类:<div\b[^>]*class=\"your-class-name-here\"[^>]*>([\s\S]*?)<\/div>
    • 对于正文标记内的内容:<body[^>]*>([\s\S]*)<\/body>
    • 对于标题标记内的内容:<head[^>]*>([\s\S]*)<\/head>
  • 直接:将任何元标记的值从源网站直接映射到任何知识文章字段。 源属性列表显示从示例网站提取的所有元标记,以及默认可用的源属性 HTML-TitleHTML-Body

    如果选择直接作为操作类型,选择 og: url 作为源属性,源属性中的 og: url 元标记的值将映射到相应的知识文章属性。

  • 常数:在任何知识文章字段中输入常数值。 源属性是一个文本字段,您可以在其中输入常数值。

  • RegexUrl:与 Regex 一样,但只在源网站的 URL 中查找匹配项。 要将整个源网站 URL 映射到知识属性字段,在操作类型中选择 Regexurl,在源属性中使用 (. *) 模式。

下面是一个示例,解释如何映射文章属性。

示例

示例 HTML:

<html>
<head>
	<meta charset="utf-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<meta property="og:type" content="website" />
	<meta property="og:url" content="https://contoso.com/en-us/id/2911cacd-efa5-4593-ae22-e09ae14c6698/ee734739(v=msdn.10)" />
	<meta name="ms.keywords" content="XML Reader, WS-Trust" />
</head>	
<title>WSTrustRequestSerializer.CanRead Method (Microsoft.IdentityModel.Protocols.WSTrust) | Microsoft Learn</title>
<body lang="en-us" dir="ltr">
	<div id="ms-descriptionArticle">
	 Checks if an XML reader is positioned at a WS-Trust RequestSecurityToken element. This is crucial for handling security token requests in .NET applications using Windows Identity Foundation (WIF).
	</div>
	<div id="ms--content-well-notifications" data-bi-name="content-well-notification">
	</div>
	<p>Starting with the .NET Framework 4.5, Windows Identity Foundation (WIF) has been fully integrated into the .NET Framework. The version of WIF addressed by this topic, WIF 3.5, is deprecated and should only be used when developing against the .NET Framework 3.5 SP1 or the .NET Framework 4. For more information about WIF in the .NET Framework 4.5, also known as WIF 4.5</p>
	<p>When implemented in a derived class, checks if the specified XML reader is positioned at a WS-Trust RequestSecurityToken element.</p>
	<p><strong>Namespace:</strong> Microsoft.IdentityModel.Protocols.WSTrust<br/>
	<strong>Assembly:</strong> Microsoft.IdentityModel (in Microsoft.IdentityModel.dll)</p>
	<h2 id="usage">Usage</h2>
	<pre><code class="lang-vb">'Usage
	Dim instance As WSTrustRequestSerializer
	Dim reader As XmlReader
	Dim returnValue As Boolean

	returnValue = instance.CanRead(reader)
	</code></pre>
	<h4 id="parameters">Parameters</h4>
	<ul>
	<li><strong>reader</strong><br/>
	The XmlReader object from which to read.</li>
	</ul>
	<h4 id="return-value">Return Value</h4>
	<p><strong>true</strong> if the reader is positioned at an RST element that the serializer can read; otherwise, <strong>false</strong>.</p>
</body>
</html>

使用以下操作类型将源属性映射到示例 html 文件中的目标:

屏幕截图解释所选 html 文件的映射。

其中

  • 文章属性内容
  • 操作类型Regex
  • 源属性:<body[^>]>([\s\S])</body>

示例 regex 提取 HTML 文件的正文标记中的全部内容。

  • 文章属性外部引用 ID
  • 操作类型RegexUrl
  • 源属性^https://.?/id/(.?)/.*$

RegexUrl 从 HTML 文件中提取 id - 2911cacd-efa5-4593-ae22-e09ae14c6698

  • 文章属性标题
  • 操作类型Direct
  • 源属性HTML-Title

Direct 提取 HTML 文件的 Title 字段中的内容,例如,WSTrustRequestSerializer.CanRead Method (Microsoft.IdentityModel.Protocols.WSTrust) | Microsoft Learn

  • 文章属性说明
  • 操作类型Regex
  • 源属性<div\b[^>]id="ms-descriptionArticle"[^>]>([\s\S]*?)</div>

示例 regex 根据 ID 从特定 div 标记提取内容。 这里,ms-desciptionArticle 是 html 中 div 标记的 id。

  • 文章属性关键字
  • 操作类型Direct
  • 源属性ms.keywords

Direct 提取 HTML 文件的 ms.keywords 字段中的内容,例如,XML Reader, WS-Trust

JSON 架构

详细了解用于构建元数据映射模板的架构详细信息

  1. 在 Customer Service 管理中心或 Contact Center 管理中心站点地图的知识文章架构>JSON 架构部分,将您的文章属性和架构 JSON 复制并粘贴到提供给您的字段中。

  2. 选择验证 JSON

    如果验证成功,将显示确认消息。 如果验证失败,您将看到一条错误消息,确定具有错误值的参数。

  3. 选择下一步前往下一节。 如果要停止,之后再返回,选择另存为草稿

后续步骤

管理集成式搜索提供程序