0
votes

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?

1
just add the blob path in the mongodb document ?Thomas
@Thomas My Problem 1 explains the same. I added the blob path and while associating the base64 encoded blob path it is never same as metadata_storage_pathSudhakar Reddy
Is the stored blob path in MongoDB base64 encoded or is it in plain text? Does your node.js encoding function match any option here (docs.microsoft.com/en-us/azure/search/…)?8163264128
It was stored as plain text.Sudhakar Reddy
You can also use field mappings to "fork" the metadata_storage_path field into a new encoded field in your index.Eugene Shvets

1 Answers

0
votes

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://docs.microsoft.com/en-us/azure/search/search-indexer-field-mappings#base64EncodeFunction for all the options to match your node.js encoding function.