Reputation: 183
I was trying to index the blob content to Azure search. I added blob content to the search index through blob indexer.
I am using MongoDB to store the uploaded file information along with blob path. We have to add some tags to the file which were stored in MongoDB. Now I want to add these tags into Azure search for that file along with file content.
The problem I am facing is,
Problem 1: To maintain the uniqueness(search key field) between MongoDB record and blob indexer. Initially, I want to use the metadata_storage_path from blob indexer and the base64 encoded blob path which I was stored in MongoDB. But the problem is it never matches the metadata_storage_path and base64 encoded blob path from my node.js.
Problem 2: TO solve the Problem 1, I came into another approach to store my MongoDB file id(FID) as a custom metadata field to the blob to get the uniqueness(search key field) for search index and mongoDB record. The problem here how can I map the custom metadata field to key field? I am not able to index the blob custom metadata fields.
In both the scenarios I am not able to achieve the expected results. How can I achieve the search index key field between MongoDB and Azure blob?
Upvotes: 1
Views: 935
Reputation: 787
You can use base64 encoded blob path as the document key, which you can get in both indexers by using base64 field mapping. Check https://learn.microsoft.com/en-us/azure/search/search-indexer-field-mappings#base64EncodeFunction for all the options to match your node.js encoding function.
Upvotes: 1