I have a blob container in a storage account where each blob is an image. I've added "w" and "h" metadata fields to each blob containing the width and height of the image.

I've followed the instructions here to add a search service to the blob store except I added the metadata and not the blob content.

I can confirm the metadata is there and valid, if I browse the blobs in the Azure portal I can see the fields with valid data and if I execute "search=*" in the search explorer I get this back for each blob:

            "@search.score": 1,
            "w": 640,
            "h": 424,
            "metadata_storage_path": "......"

My problem is I want to search by image width(w) and height(h) and can't workout how.

Tried these example queries to search for w=640 with no luck, just returns all blobs or errors:

search=*&w eq 640
w eq 640

One thing I've noticed is that when writing the blob metadata (I used the Azure storage Python library) you can only write string data. But when you specifiy the fields in the data source can set them as int32.

How do I enable filterable searching over blob metadata fields?

Edit: As per SumanthMarigowda-MSFT's answer, I looked a this doc, and in my case here are some example queries:

Only 640x480:

search=*&$filter=(w eq 640 and h eq 480)

All with w betwen 640 and 700:

search=*&$filter=(w ge 640 and w lt 700)

There is a similar query discussion on the MSDN forum, you may refer to the suggestion mentioned in this link.

  • answered this on my question over on the MS Azure forum. I'll add another answer with specific details on my problem now it's solved. – Geordie Aug 23 '19 at 20:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.