0
votes

Is there a way to use metadata on an Azure storage container as a filter in Azure Cognitive Search?

I'm aware that metadata on individual blobs in an Azure storage container can be used as search filters.

https://docs.microsoft.com/en-us/azure/search/search-howto-indexing-azure-blob-storage#how-azure-cognitive-search-indexes-blobs

User-specified metadata properties present on the blob, if any, are extracted verbatim. Note that this requires a field to be defined in the index with the same name as the metadata key of the blob. For example, if your blob has a metadata key of Sensitivity with value High, you should define a field named Sensitivity in your search index and it will be populated with the value High.

Is there a way to filter searches based on metadata at the container level instead of the blob level? If not, are there other ways to filter searches by storage container?

2

2 Answers

1
votes

Unfortunately, we cannot use metadata on an Azure storage container as a filter in Azure Cognitive Search yet.

Generally in this situation, you can put forward your needs on the feedback, I see that there are already people who want to add this feature, you just need to vote for it now.

1
votes

Yes, there is a way. If you don't use the built-in indexer that pulls content, but instead use the SDK to push content, you can add whatever metadata you want. And they can obviously be refiners.

This means you have to write code to read items from blob storage. You have to handle the logic for updates, etc. You don't get the benefit the built-in indexer gives you. But, you gain control over what metadata you include.