Azure 如何将不同的自定义技能集映射到索引

Azure 如何将不同的自定义技能集映射到索引,azure,azure-functions,azure-cognitive-search,azure-cognitive-services,azure-search-.net-sdk,Azure,Azure Functions,Azure Cognitive Search,Azure Cognitive Services,Azure Search .net Sdk,尝试在技能集中添加自定义技能并将其映射到索引中 这里有详细的信息 我在技能集中使用azure命名实体识别作为 { "@odata.type": "#Microsoft.Skills.Text.MergeSkill", "description": "Merge text content with image tags", "insertPreTag": " ", "context": "/document",

尝试在技能集中添加自定义技能并将其映射到索引中

这里有详细的信息

我在技能集中使用azure命名实体识别作为

    {
        "@odata.type": "#Microsoft.Skills.Text.MergeSkill",
        "description": "Merge text content with image tags",
        "insertPreTag": " ",
        "context": "/document",
        "inputs": [
            {
                "name": "text",
                "source": "/document/fullTextAndCaptions"
            },
            {
                "name": "itemsToInsert",
                "source": "/document/normalized_images/*/Tags/*/name"
            }
        ],
        "outputs": [
            {
                "name": "mergedText",
                "targetName": "finalText"
            }
        ]
    }
在索引器中作为

    {
        "sourceFieldName": "/document/finalText/pages/*/entities/*/value",
        "targetFieldName": "entities"
    },
    {
        "sourceFieldName": "/document/finalText/pages/*/locations/*",
        "targetFieldName": "locations"
    },
现在它100%工作了,我想添加与之不同的自定义技能 我确实发布了这个函数,当我去手动测试它时,它会按预期工作。 然而,总的来说,它在技能方面不起作用。我希望它获取位置并对其进行过滤,并仅在搜索索引中它自己的字段中输出distinct。 我真的很难配置技能集和索引器来让它工作


有什么帮助吗?

自定义技能的技能输入必须配置为指向要消除歧义的数据。在这种情况下,您实际上不需要修改代码,只需输入一个名为“words”和source“/document/finalText/pages//locations/”的输入即可。

如果您想在整个文档中消除重复数据,则需要添加这样独特的自定义技能

{
    "skills": [
        ...

        {
            "@odata.type": "#Microsoft.Skills.Custom.WebApiSkill",
            "description": "Distinct skill",
            "uri": "<https://distinct-skill>",
            "context": "/document",
            "inputs": [
                {
                    "name": "locations",
                    "source": /document/finalText/pages/*/locations/*"
                }
            ],
            "outputs": [
                {
                    "name": "distinct",
                    "targetName": "distinctLocations"
                }
            ]
        }

        ...
    ]
}

有关添加自定义技能的详细信息,请参阅。

您还可以从技能集中为distinct自定义技能添加json吗?因此,distinct的json是我的问题,我不知道怎么做。我一直在尝试不同的方法,但失败了。你可以在我在问题中发布的链接上看到示例一。在发布之前,我将distinct.cs中的第46行更改为“JArray wordsParameter=inRecord.Data.TryGetValue(“locations”,out object wordsParameterObject)”,因此它接受location字段而不是words字段。所以我需要帮助创建技能集
    {
        "sourceFieldName": "/document/distinctLocations",
        "targetFieldName": "distinctLocations"
    }