メタデータ マッピング テンプレートを作成するためのスキーマの詳細

注意

機能の可用性情報は次のとおりです。

Dynamics 365 Contact Center - 埋め込み Dynamics 365 Contact Center - スタンドアロン Dynamics 365 Customer Service
いいえ

この記事では、外部データ プロバイダーからナレッジ記事エンティティに情報をマップするために必要なスキーマの詳細と、さまざまなフィールドと属性を使用して独自のスキーマ マッピング JSON ファイルを準備する方法について説明します。

Fields

次の表に、JSON スキーマで使用する必要があるフィールドとフィールドの詳細を示します。

フィールド名 Definition Required 価値
件名 フィールド説明の名前 番号 フィールドの名前を示す文字列。
UniqueTargetFieldName サポート情報記事エンティティの一意の識別子または代替キーを表します。 通常、このフィールドはコンテンツ プロバイダー側の ID です。 イエス フィールドの名前を示す文字列。 値を "msydn_externalreferenceid" に設定できます
ContentTargetFieldName フィールドの値は変更できません。 イエス 値を "content" に設定します。
ApiPathLeafName フィールドの値は変更できません。 イエス 値を "knowledgearticles" に設定します。
List<FieldDefinitions> フィールド説明のリストです。 イエス フィールドの定義のセット。 フィールド定義の設定でサポートされているフィールドのリストについては、次の表を参照してください。

フィールド定義

次の表に、メタデータ マッピング スキーマで使用できる必須およびオプションの属性を示します。

フィールド名 Definition Required 価値
TargetFieldName ナレッジ記事エンティティのターゲットの理論フィールド名です。 イエス ターゲット フィールドの名前を示す任意の文字列
TargetFieldType ターゲット フィールドの種類を示します。 イエス フィールドの種類を示す文字列。
DocFieldSource 実行時にソース フィールドの値を識別して解決する方法を示す イエス 値を次のソース タイプのひとつに設定します:
  • 正規表現
  • Meta
  • 定数
  • Url
  • Document
これらのデータ タイプについては、次のフィールド ソース タイプ セクションを参照してください。
DocFieldPattern 取得する対象フィールドの性質を示します。 番号 この値は、DocFieldSource 値に基づいて設定します。 DocFieldPatterns の設定方法については、以下の例を参照してください。
MaxLength 対象フィールドに格納できる文字列の最大長です。 いいえ。 TargetFieldType 属性が文字列型の場合に使用できます Int
UseRegexCapture URL に適用できる正規表現パターンを格納します。 いいえ。 TargetFieldType 属性が String 型で、DocFieldSource 属性がUrl型の場合に使用できます。 URL または文字列。

フィールド ソースの種類

外部検索プロバイダーのデータは、次のフィールド ソース タイプのいずれかに設定できます。

  • Regex: 正規表現タイプのデータを示すために使用します。
  • Meta: ターゲット フィールド値がソース記事の <meta> タグから取得されることを示すために使用します
  • Constant: ターゲット フィールドに静的な値を設定するために使用します。
  • Url : 外部ソース ドキュメントのURLを示すために使用します。
  • Document : 外部ソース ドキュメントのURLを示すために使用します。

独自のメタデータ マッピング テンプレートを作成する際の考慮事項

独自のマッピング スキーマを開発する場合は、いくつかの必須フィールドを構成し、一部のフィールド定義にデフォルト値を設定する必要があります。

マッピング テンプレートには次が含まれている必要があります。

  • UniqueTargetFieldNameContentTargetFieldNameApiPathLeafName のフィールド。 これらのフィールドは、次のように必要な値に設定する必要があります。

    • UniqueTargetFieldName をすぐに使える msdyn_externalreferenceid フィールドまたはカスタム フィールドに設定します。 カスタム フィールドを使用している場合は、そのフィールドを代替キーとして追加してください。 詳細: Dynamics 365 レコードを参照する代替キーの定義
    • ContentTargetFieldName フィールドを含め、その値を "content" に設定します。
    • ApiPathLeafName フィールドを含め、その値を "knowledgearticles" に設定します。
    • FieldDefinitions リストの UniqueTargetFieldContentTargetField のフィールド両方のマッピングを提供していることを確認してください。

    マッピング スキーマは次のようになります。

    
      {
        "Name": "{To be filled by you}",
        "UniqueTargetFieldName": "msdyn_externalreferenceid",
        "ContentTargetFieldName": "content",
        "ApiPathLeafName": "knowledgearticles"
        "FieldDefinitions": []
      }
    
    
  • 以下の FieldDefinitions リストを含め、FieldUse DocFieldSourceTargetFieldNameTargetFieldType にデフォルトのような属性にデフォルト値を入力します。 テンプレートには、次のフィールドと属性をその値とともに "そのまま" 必ず含めてください。 ただし、タイトルおよびコンテンツ値フィールドの Docfieldsource および Docfieldpattern は、RegexMetaDocumentConstant、または Url のいずれかに設定できます。

    
      {
        "FieldUse": "Create",
        "DocFieldSource": "ArticlePublicNumber",
        "TargetFieldName": "articlepublicnumber",
        "TargetFieldType": "String"
      },
      {
         "DocFieldSource": "Constant",
         "DocFieldPattern": "true",
         "TargetFieldName": "msdyn_isingestedarticle",
         "TargetFieldType": "Boolean"
      },
      {
         "DocFieldSource": "Url",
         "TargetFieldName": "msdyn_ingestedarticleurl",
         "TargetFieldType": "String"
      },
      {
         "DocFieldSource": "DataProvider",
         "TargetFieldName": "msdyn_integratedsearchproviderid@odata.bind",
         "TargetFieldType": "String"
      },
      {
         "DocFieldSource": "Regex",
         "DocFieldPattern": "<title>(.*?)</title>",
         "TargetFieldName": "title",
         "TargetFieldType": "String"
      },
      {
         "DocFieldSource": "Url",
         "TargetFieldName": "msdyn_externalreferenceid",
         "TargetFieldType": "String",
         "UseRegexCapture": "^https://.*?/(.*?)/.*/.*?([0-9A-F]{8}[-](?:[0-9A-F]{4}[-]){3}[0-9A-F]{12})$"
     }, 
      {
         "DocFieldSource": "Document",
         "TargetFieldName": "content",
         "TargetFieldType": "String"
      }
    
    
  • 必須フィールドと属性情報をリストしたら、追加のメタデータ マッピングを含めて、それらに独自のカスタム値を設定できます。 たとえば、DocFieldSource のような Meta タイプを含めることができ、次のような属性のカスタム値を設定します。

    
       {
         "DocFieldSource": "Meta",
         "DocFieldPattern": "description",
         "TargetFieldName": "description",
         "TargetFieldType": "String",
         "MaxLength": 155
        }
    
    

サンプル メタデータ マッピング テンプレート

次のメタデータ マッピング JSON サンプルをテンプレートとして使用して、独自のカスタム マッピング テンプレートを作成できます。


   {
     "Name": "Integrated Search Data Provider Name",
     "UniqueTargetFieldName": "msdyn_externalreferenceid",
     "ContentTargetFieldName": "content",
     "ApiPathLeafName": "knowledgearticles",
     "FieldDefinitions": [
     {
       "FieldUse": "Create",
       "DocFieldSource": "ArticlePublicNumber",
       "TargetFieldName": "articlepublicnumber",
       "TargetFieldType": "String"
      },
      {
        "DocFieldSource": "Constant",
        "DocFieldPattern": "true",
        "TargetFieldName": "msdyn_isingestedarticle",
        "TargetFieldType": "Boolean"
      },
      {
        "DocFieldSource": "Url",
        "TargetFieldName": "msdyn_ingestedarticleurl",
        "TargetFieldType": "String"  
      },
      {
        "DocFieldSource": "DataProvider",
        "TargetFieldName": "msdyn_integratedsearchproviderid@odata.bind",
        "TargetFieldType": "String"
      },
      {
        "DocFieldSource": "Regex",
        "DocFieldPattern": "<title>(.*?)</title>",
        "TargetFieldName": "title",
        "TargetFieldType": "String"
       },
       {
          "DocFieldSource": "Meta",
          "DocFieldPattern": "description",
          "TargetFieldName": "description",
          "TargetFieldType": "String",
          "MaxLength": 155
       },
       {
          "DocFieldSource": "Document",
          "TargetFieldName": "content",
          "TargetFieldType": "String"
        },
        {
          "DocFieldSource": "Url",
          "TargetFieldName": "msdyn_externalreferenceid",
          "TargetFieldType": "String",
          "UseRegexCapture": "^https://.*?/(.*?)/.*/.*?([0-9A-F]{8}[-](?:[0-9A-F]{4}[-]){3}[0-9A-F]{12})$"
        }
    ]
 }

外部ソース データを変換し、ナレッジ フィールドにマッピングする

外部データ プロバイダーからナレッジ記事エンティティに情報をマッピングする際、ソース値が異なるデータ型である場合、ターゲット ナレッジ フィールドにマッピングする前に値を変換する必要があります。 詳細: 外部ソース データを変換し、対応するターゲット ナレッジ属性にマッピングする

関連情報

統合検索プロバイダーを管理する
検索プロバイダーのインサイトを表示して使用する