Cloudinary allows access to two types of resource metadata (MD). The first type of metadata is the embedded metadata that a resource has and the second one is the structured metadata.
It's possible to search for resources based on either one of the MD types.
Types of Metadata
Embedded metadata is MD like EXIF or XMP which is integrally built in the resource. This is metadata that the resource itself would have before being uploaded to Cloudinary. For example, images taken using a mobile device would usually have a rotation angle embedded in the image file.
Structured metadata is a set of custom fields that you can define at the cloud level and assign to resources using Cloudinary. For each field you define, you can specify a field name, value type (string, number, date, list, etc), and other optional settings. You can read more about managing structured metadata
How to search for resources based on Metadata using the search API
It's possible to search for resources based on either embedded metadata or structured metadata using Cloudinary's search API
The search API uses query language to search resources and it is possible to build complex expressions to base the search on.
Searching using structured metadata requires using the `metadata` field in the search expression.
You would need to specify both the metadata field name and the value you would like to search by. An example of a search component for a structured metadata field can be seen here:
metadata.quantity_id<10
You can see a full explanation and additional details on how to search using structured metadata in our documentation about search fields
Searching using embedded metadata is possible in using the search API as well. This type of search is available on Tier 2 of the search API which is available upon request for Advanced plans and higher. Note that tier 2 is provided at an extra cost.
In order to search using embedded metadata it's possible to use the `image_metadata` field of the search API. In order to search using embedded metadata, you would need to add the name of the metadata field.
An example of a search component for an embedded metadata field called license can be seen here:
image_metadata.license=a1s3d5f7a9s2d4f
You can read more detailed information on how to search using the API and using embedded metadata in our documentation
How to search for resources based on Metadata using the web console
On our web console, it's possible to search for resources using structured metadata that was previously created, and also by contextual MD that can be added.
In order to do so, you can go to the media library and click on the "advanced search" icon to the right of the search bar. Following that go to the "metadata" tab and choose the metadata field and value you want to search by.
The below video explains that in further detail:
Searching by embedded metadata is currently only possible from the global search bar. In order to do that go to the blue "menu" icon on the top left of the media library.
Then go to the preferences section and click to enable the option to "Include embedded metadata in global search results". Once the checkbox is enabled, click "save" on the bottom of the page.
The below video explains that in further details:
Enabling the option to search for embedded metadata currently allows searching for specific strings only on the global search bar.
It is on our roadmap to allow a more granular search of embedded metadata as well.
Comments
0 comments
Please sign in to leave a comment.