Is it possible to use metadata as input for custom skill in azure search?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
I started working with Azure search a couple of months ago but I have an issue with the metadata of blobfiles.
I need the metadata of a file (coming from Azure Blob) to use it in my customskill. (More specific I need the URL of the blobfile where it's stored).
To do this I need it in my skillset, I would do something like in this image. But that's not possible because the source has to start with /document? If I do "/document/metadata_storage_path/" as "Source" I got a null value in the end?
Is there a way to get the metadata of a file as input to use it further on?
Thanks in advance!
add a comment |
I started working with Azure search a couple of months ago but I have an issue with the metadata of blobfiles.
I need the metadata of a file (coming from Azure Blob) to use it in my customskill. (More specific I need the URL of the blobfile where it's stored).
To do this I need it in my skillset, I would do something like in this image. But that's not possible because the source has to start with /document? If I do "/document/metadata_storage_path/" as "Source" I got a null value in the end?
Is there a way to get the metadata of a file as input to use it further on?
Thanks in advance!
add a comment |
I started working with Azure search a couple of months ago but I have an issue with the metadata of blobfiles.
I need the metadata of a file (coming from Azure Blob) to use it in my customskill. (More specific I need the URL of the blobfile where it's stored).
To do this I need it in my skillset, I would do something like in this image. But that's not possible because the source has to start with /document? If I do "/document/metadata_storage_path/" as "Source" I got a null value in the end?
Is there a way to get the metadata of a file as input to use it further on?
Thanks in advance!
I started working with Azure search a couple of months ago but I have an issue with the metadata of blobfiles.
I need the metadata of a file (coming from Azure Blob) to use it in my customskill. (More specific I need the URL of the blobfile where it's stored).
To do this I need it in my skillset, I would do something like in this image. But that's not possible because the source has to start with /document? If I do "/document/metadata_storage_path/" as "Source" I got a null value in the end?
Is there a way to get the metadata of a file as input to use it further on?
Thanks in advance!
edited Jan 7 at 8:37
Community♦
11
11
asked Jan 4 at 15:43
AxxeptionAxxeption
5117
5117
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
I think your source path would have to be "/document/metadata_storage_path" without the extra "/" at the end. With the extra "/", the source path is interpreted to be a directory within metadata_storage_path that has the name of "" (empty string).
Thanks for your reply! But I tried that, but it didn't seem to work.
– Axxeption
Jan 9 at 15:01
That is very strange. Are you using metadata_storage_path as the key?
– Sophiac
Jan 11 at 19:24
I found why it was not working! Thanks for your reply! I hope you can learn from it as well!
– Axxeption
Feb 7 at 9:32
add a comment |
I discovered why it (and the solutions) were not working for me. I hope I can help others that encounter this issue.
The syntax mentioned above by Sophiac was correct. So in my case I used "metadata_storage_path" as input in the skillset:
{
"@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"
}
]
}
The issue was in the indexer. I mapped in the fieldmapping the "metadata_storage_path" to something else (in my case "blob_uri"). The problem is this is not really a mapping but more like a replacement. So the "metadata_storage_path" was empty in the skillset because it was already replaced.
But if I use "blob_uri" it is working.
Solution is that you can map one input to more than one thing in the indexer:
"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"
}
],
Now I can use the "blob_uri" and the "metadata_storage_path" as an input for my customskill.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54042074%2fis-it-possible-to-use-metadata-as-input-for-custom-skill-in-azure-search%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
I think your source path would have to be "/document/metadata_storage_path" without the extra "/" at the end. With the extra "/", the source path is interpreted to be a directory within metadata_storage_path that has the name of "" (empty string).
Thanks for your reply! But I tried that, but it didn't seem to work.
– Axxeption
Jan 9 at 15:01
That is very strange. Are you using metadata_storage_path as the key?
– Sophiac
Jan 11 at 19:24
I found why it was not working! Thanks for your reply! I hope you can learn from it as well!
– Axxeption
Feb 7 at 9:32
add a comment |
I think your source path would have to be "/document/metadata_storage_path" without the extra "/" at the end. With the extra "/", the source path is interpreted to be a directory within metadata_storage_path that has the name of "" (empty string).
Thanks for your reply! But I tried that, but it didn't seem to work.
– Axxeption
Jan 9 at 15:01
That is very strange. Are you using metadata_storage_path as the key?
– Sophiac
Jan 11 at 19:24
I found why it was not working! Thanks for your reply! I hope you can learn from it as well!
– Axxeption
Feb 7 at 9:32
add a comment |
I think your source path would have to be "/document/metadata_storage_path" without the extra "/" at the end. With the extra "/", the source path is interpreted to be a directory within metadata_storage_path that has the name of "" (empty string).
I think your source path would have to be "/document/metadata_storage_path" without the extra "/" at the end. With the extra "/", the source path is interpreted to be a directory within metadata_storage_path that has the name of "" (empty string).
answered Jan 8 at 22:25
SophiacSophiac
261
261
Thanks for your reply! But I tried that, but it didn't seem to work.
– Axxeption
Jan 9 at 15:01
That is very strange. Are you using metadata_storage_path as the key?
– Sophiac
Jan 11 at 19:24
I found why it was not working! Thanks for your reply! I hope you can learn from it as well!
– Axxeption
Feb 7 at 9:32
add a comment |
Thanks for your reply! But I tried that, but it didn't seem to work.
– Axxeption
Jan 9 at 15:01
That is very strange. Are you using metadata_storage_path as the key?
– Sophiac
Jan 11 at 19:24
I found why it was not working! Thanks for your reply! I hope you can learn from it as well!
– Axxeption
Feb 7 at 9:32
Thanks for your reply! But I tried that, but it didn't seem to work.
– Axxeption
Jan 9 at 15:01
Thanks for your reply! But I tried that, but it didn't seem to work.
– Axxeption
Jan 9 at 15:01
That is very strange. Are you using metadata_storage_path as the key?
– Sophiac
Jan 11 at 19:24
That is very strange. Are you using metadata_storage_path as the key?
– Sophiac
Jan 11 at 19:24
I found why it was not working! Thanks for your reply! I hope you can learn from it as well!
– Axxeption
Feb 7 at 9:32
I found why it was not working! Thanks for your reply! I hope you can learn from it as well!
– Axxeption
Feb 7 at 9:32
add a comment |
I discovered why it (and the solutions) were not working for me. I hope I can help others that encounter this issue.
The syntax mentioned above by Sophiac was correct. So in my case I used "metadata_storage_path" as input in the skillset:
{
"@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"
}
]
}
The issue was in the indexer. I mapped in the fieldmapping the "metadata_storage_path" to something else (in my case "blob_uri"). The problem is this is not really a mapping but more like a replacement. So the "metadata_storage_path" was empty in the skillset because it was already replaced.
But if I use "blob_uri" it is working.
Solution is that you can map one input to more than one thing in the indexer:
"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"
}
],
Now I can use the "blob_uri" and the "metadata_storage_path" as an input for my customskill.
add a comment |
I discovered why it (and the solutions) were not working for me. I hope I can help others that encounter this issue.
The syntax mentioned above by Sophiac was correct. So in my case I used "metadata_storage_path" as input in the skillset:
{
"@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"
}
]
}
The issue was in the indexer. I mapped in the fieldmapping the "metadata_storage_path" to something else (in my case "blob_uri"). The problem is this is not really a mapping but more like a replacement. So the "metadata_storage_path" was empty in the skillset because it was already replaced.
But if I use "blob_uri" it is working.
Solution is that you can map one input to more than one thing in the indexer:
"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"
}
],
Now I can use the "blob_uri" and the "metadata_storage_path" as an input for my customskill.
add a comment |
I discovered why it (and the solutions) were not working for me. I hope I can help others that encounter this issue.
The syntax mentioned above by Sophiac was correct. So in my case I used "metadata_storage_path" as input in the skillset:
{
"@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"
}
]
}
The issue was in the indexer. I mapped in the fieldmapping the "metadata_storage_path" to something else (in my case "blob_uri"). The problem is this is not really a mapping but more like a replacement. So the "metadata_storage_path" was empty in the skillset because it was already replaced.
But if I use "blob_uri" it is working.
Solution is that you can map one input to more than one thing in the indexer:
"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"
}
],
Now I can use the "blob_uri" and the "metadata_storage_path" as an input for my customskill.
I discovered why it (and the solutions) were not working for me. I hope I can help others that encounter this issue.
The syntax mentioned above by Sophiac was correct. So in my case I used "metadata_storage_path" as input in the skillset:
{
"@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"
}
]
}
The issue was in the indexer. I mapped in the fieldmapping the "metadata_storage_path" to something else (in my case "blob_uri"). The problem is this is not really a mapping but more like a replacement. So the "metadata_storage_path" was empty in the skillset because it was already replaced.
But if I use "blob_uri" it is working.
Solution is that you can map one input to more than one thing in the indexer:
"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"
}
],
Now I can use the "blob_uri" and the "metadata_storage_path" as an input for my customskill.
answered Feb 7 at 9:46
AxxeptionAxxeption
5117
5117
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54042074%2fis-it-possible-to-use-metadata-as-input-for-custom-skill-in-azure-search%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown