/azure-search-custom-skill

This repo shows a simple custom skill for Azure Cognitive Search

Primary LanguagePython

azure-search-custom-skill

Steps to use this custom skill:

  1. Adapt regex

  2. Deploy skill to Azure Function (Python) using vscodes or az cli

  3. Add skill entry to skillset and adapt fields

    ...
    {
        "@odata.type": "#Microsoft.Skills.Custom.WebApiSkill",
        "name": "productids",
        "description": "RegEx extraction Skill",
        "uri": "https://<name>.azurewebsites.net/api/RegexExtractor?code=<key>",
        "context": "/document/merged_content",
        "inputs": [
            {
                "name": "text",
                "source": "/document/merged_content"
            }
        ],
        "outputs": [
            {
                "name": "matches",
                "targetName": "product_ids"
            }
        ]
    },
    ...
    
  4. Create new field of type Collection(Edm.String) in index Add new field

  5. Add entry for outputFieldMappings to indexer

    ...
    {
        "sourceFieldName": "/document/merged_content/product_ids",
        "targetFieldName": "product_ids"
    },
    ...
    
  6. Re-index data