Warm tip: This article is reproduced from serverfault.com, please click

How to store Azure Cognitive Search result into Cosmos DB

发布于 2020-11-26 01:13:46

In the SkillSet of Azure Cognitive Search, we can define a knowledge store so that the search result to be saved to Azure table storage.

For example, the skill set below allows the search result to be stored in Azure table storage.

{
    "name": "your-skillset",
    "skills": [
    …your skills
    ],
"cognitiveServices": {
… your cognitive services key info
    },

    "knowledgeStore": {
    "storageConnectionString": "an Azure storage connection string",
    "projections" : [
        {
        "tables": [
            { "tableName": "MainTable", "generatedKeyName": "SomeId", "source": "/document/EnrichedShape" },
            { "tableName": "KeyPhrases", "generatedKeyName": "KeyPhraseId", "source": "/document/EnrichedShape/*/KeyPhrases/*" },
            { "tableName": "Entities", "generatedKeyName": "EntityId", "source": "/document/EnrichedShape/*/Entities/*" }
        ]
        },
        {
        "objects": [ ]
        },
        {
            "files": [ ]
        }
    ]
    }
}

I've modified the storageConnectionString to be the one from Cosmos DB expecting that the search result to be projected to cosmos DB, but it didn't and show the error message the storageConnectionString is not table connection string.

Is it possible to project Azure search results to Cosmos DB by configuring the skillset?

Questioner
Joe Park
Viewed
0
Carey Halton 2020-12-01 01:17:22

Cosmos DB projections are not currently possible using the knowledge store feature, however it is on our radar as a possible projection option in the future. If you feel strongly about this as an option, you can request this feature on our user voice forum.

In the meantime, if you are willing to do a bit more setup work, you can always implement a custom web api skill to do anything with skillset data that you please, including uploading it to a different data sink.