我认为你的源路径必须是“/ document / metadata_storage_path”,最后没有额外的“/”。使用额外的“/”,源路径被解释为metadata_storage_path中的名称为“”(空字符串)的目录。
我发现为什么它(和解决方案)不适合我。我希望我能帮助遇到这个问题的其他人。
上面提到的语法 Sophiac 是对的。所以在我的情况下,我使用“metadata_storage_path”作为技能组的输入:
{ "@odata.type": "#Microsoft.Skills.Custom.WebApiSkill", "description": "Our new substring custom skill", "uri": "https://customskillsubstring.azurewebsites.net/api/Translate?code=OkzL7G3wX----jCqQylUyJJPaggSaFQCaQ==", "batchSize":1, "context": "/document", "inputs": [ { "name": "text", "source": "/document/metadata_storage_path" } ], "outputs": [ { "name": "text", "targetName": "metadata_storage_path_wathever" } ] }
问题出在索引器中。我将字段映射到“metadata_storage_path”到其他东西(在我的例子中是“blob_uri”)。问题是这不是真正的映射,而更像是替代品。因此,“metadata_storage_path”在技能组中为空,因为它已被替换。
但是,如果我使用“blob_uri”它是有效的。 解决方案是您可以将一个输入映射到索引器中的多个内容:
"fieldMappings" : [ { "sourceFieldName" : "metadata_storage_name", "targetFieldName" : "id", "mappingFunction" : { "name" : "base64Encode" } }, { "sourceFieldName" : "content", "targetFieldName" : "content" }, { "sourceFieldName" : "metadata_storage_path", "targetFieldName" : "blob_uri" }, { "sourceFieldName" : "metadata_storage_path", "targetFieldName" : "metadata_storage_path" } ],
现在我可以使用“blob_uri”和“metadata_storage_path”作为我的习俗的输入。