我开始了几个月前与Azure的搜索工作,但我有blobfiles的元数据的问题。
我需要一个文件(从Azure的斑点推出)的元数据在我customskill使用它。 (更具体的,我需要在那里的存储blobfile的URL)。
要做到这一点,我需要在我的技能,我会做类似的this image。但由于源已开始/文档那是不可能的?如果我做“/文件/ metadata_storage_path /”为“Source”我到底空值?
有没有办法让作为输入,以进一步利用它在文件的元数据?
提前致谢!
我觉得你的源路径必须是“/文件/ 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"
}
]
}
问题是在索引。我在fieldmapping的“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”作为我的customskill的输入。