All Products
Search
Document Center

Object Storage Service:Use AISearch to quickly search for objects based on semantic content and multimedia metadata

Last Updated:Jan 20, 2025

AISearch allows you to quickly search for target objects among a large number of objects based on conditions, such as semantic content, object metadata, multimedia metadata, object ETags and tags, and custom metadata. AISearch improves search efficiency.

Scenarios

Personal and enterprise document search

You can use AISearch to directly search for documents based on specific semantic content, such as "ERP usage", "IT maintenance process", "2024 business operation analysis", and other keywords. This allows you to conveniently search for documents and improve work efficiency.

Multimedia search

AISearch allows you to integrate fast and efficient media data search and retrieval capabilities into your multimedia networking applications. For example, you upload a large number of images to a social networking application. You can directly search for images based on semantic content, such as "spring outing in the countryside", "Spring Festival reunion", "my oceanic experiences", and other keywords, which makes your application easy and fun to use.

Online storage

Many online storage services provide scalar-based object search based on attributes such as object names, creation time, and extensions. AISearch allows you to efficiently search for specific types of data, such as semantically related documents and photos.

Video surveillance

AISearch allows you to search for surveillance videos based on semantic keywords, such as "outdoor snow surveillance video" and "orchard on sunny days".

Notes

  • Supported regions

    AISearch is supported for buckets in the China (Qingdao), China (Beijing), China (Zhangjiakou), China (Hangzhou), China (Shanghai), China (Shenzhen), China (Guangzhou), and China (Chengdu) regions.

  • Object quantity

    AISearch is supported only for a bucket that contains a maximum of 10 billion objects. If the number of objects in a bucket does not exceed 100 million, you can directly enable AISearch. If the number of objects in a bucket exceeds 100 million, contact technical support.

  • Billing rules

    AISearch is in public preview, during which you are free to use it. After public review, you will be charged for metadata management and metadata retrievals. For more information about the billable items, see Data indexing fees.

    In addition to the aforementioned billable items, you are charged additional fees based on the number of API operation calls when you use AISearch. The following table describes the related API operations:

    Description

    API

    Number of API operation calls

    Build indexes for objects in buckets

    HeadObject and GetObject

    One call for each object

    Objects in buckets are tagged

    GetObjectTag

    One call for each tagged object

    Objects in buckets contain custom metadata

    GetObjectMeta

    One call for every object that contains custom metadata

    Symbolic links in buckets

    GetSymlink

    One call for each symbolic link object

    Scan the bucket

    ListObjects

    One call for every batch of 1,000 files that are scanned

    For more information, see API operation calling fees.

  • Time required for indexing

    After you enable AISearch, OSS creates an index. The time required to create the index is proportional to the number of objects stored in the bucket. If a larger number of objects are stored in the bucket, a longer period of time is required to create the index. In most cases, the first time you create an index for 10 million objects, approximately 1 hour is required. The first time you create an index for 1 billion objects, approximately 1 day is required. The first time you create an index for 10 billion objects, approximately 2 to 3 days are required. The preceding time is provided only for reference.

  • Multipart upload

    If a bucket contains objects that are uploaded by using multipart upload, the search results include only the complete objects combined by calling the CompleteMultipartUpload operation. Parts that are uploaded by multipart upload tasks that are initiated but are not completed or canceled are not included in the search results.

Methods

Use the OSS console

In this example, the following search conditions are used to search for objects: 1. Semantic content: luminous building; 2. Format: JPG; 3. Image width and height: smaller than 800 x 1200 pixels. The expected search result is an object named "night scene by the river.jpg".

江边的夜景

  1. Log on to the OSS console.

  2. In the left-side navigation pane, click Buckets. On the Buckets page, click the name of the bucket for which you want to enable AISearch.

  3. In the left-side navigation tree, choose Object Management > Data Indexing.

  4. On the Data Indexing page, click Enable Now.

  5. In the Data Indexing dialog box, select AISearch and click Enable.

    Note

    The time required to create a metadata index varies based on the number of objects in the bucket. You can refresh the Data Indexing page to check whether AISearch is enabled.

  6. Specify the Search Content parameter in the Semantic Content Condition section and retain the default settings for other parameters.

    • In the Semantic Content Condition section, enter a description for the image in the Search Content field. Example: luminous building.

    • Set Multimedia Type to Image.

      • Select JPG/JPEG from the drop-down list for the Image Format parameter.

      • Select Less Than from the drop-down list for the Width parameter and enter 800 in the second field.

      • Select Less Than from the drop-down list for the Height parameter and enter 1200 in the second field.

  1. Click Query Now. The object is successfully queried based on the specified conditions.

For more information about the search conditions and search result settings, see Search conditions and search result settings.

Use the OSS API

If your business requires a high level of customization, you can directly call RESTful APIs. To directly call an API, you must include the signature calculation in your code. For more information, see DoMetaQuery.

Search conditions and search result settings

Search condition settings

The following table describes all search conditions. You can specify one or more search conditions based on your business requirements.

OSS metadata conditions

Query condition

Description

Storage Class

You can specify the storage class of the object based on your business requirements.

  • If you have specified the Search Content parameter in the Semantic Condition section, you can select only Standard and IA.

  • If you have not specified the Search Content parameter in the selected Semantic Content Condition section, you can select Standard, IA, Archive, Cold Archive, and Deep Cold Archive.

ACL

By default, the following access control lists (ACLs) supported by OSS are selected: Inherited from Bucket, Private, Public Read, and Public Read/Write. You can specify the ACL based on your business requirements.

Object Name

You can select Fuzzy Match or Equal To. If you want to display the name of an object in the search results, such as exampleobject.txt, you can use one of the following methods to match the object name:

  • Select Equal To and enter the full name of the object. Example: exampleobject.txt.

  • Select Fuzzy Match and enter the prefix or suffix of the object name. Example: example or .txt.

    Important

    Fuzzy match can match all object names that contain the specified characters. For example, if you enter test next to Fuzzy Match, localfolder/test/.example.jpg and localfolder/test.jpg meet the search condition, and are displayed in the search results.

Upload Type

By default, the following upload types are selected. You can specify the upload type based on your business requirements.

  • Normal: returns objects uploaded by using simple upload in the search results.

  • Multipart: returns objects uploaded by using multipart upload in the search results.

  • Appendable: returns objects uploaded by using append upload in the search results.

  • Symlink: returns symbolic links.

Last Modified At

You can specify Start Date and End Date for Last Modified At. The values of Start Date and End Date are accurate to seconds.

Object Size

You can select Equal To, Greater Than, Greater Than or Equal To, Less Than, or Less Than or Equal To for Object Size. Unit: KB.

Object Versions

You can search for only the current versions of objects.

Object ETag and tag conditions

If you want to search for objects based on their ETags and tags, you can enter the ETags or tags of the objects that you want to display in the search results.

  • ETags support only exact match. An ETag must be enclosed in quotation marks. Example: "5B3C1A2E0563E1B002CC607C6689". If you want to specify multiple ETags, separate them with line feeds.

  • Specify Object Tags by using key-value pairs. The keys and values of object tags are case-sensitive. For more information about tag rules, see Add tags to an object.

Multimedia metadata conditions

You can search for objects based on specific attributes of images, documents, audio objects, and videos.

Query condition

Description

Image

  • Formats: JPG/JPEG, PNG, APNG, BMP, GIF, WEBP, TIFF, HEIC, HEIC-SEQUENCE, and AVIF.

  • Width and height: allows you to specify the width and height range. Unit: pixels.

Document

  • Formats: DOC, DOCX, PPTX, PPT, XLS, XLSX, PDF, RTF, TXT, LOG, XML, and HTML.

Video

  • Formats: AVI, MPEG, MPG, RM, MOV, WMV, 3GP, MP4, FLV, MKV, and TS.

  • Resolution: allows you to specify the video resolution range. Unit: pixels.

  • Duration: allows you to specify the duration range. Unit: seconds.

  • Bitrate: allows you to specify the bitrate range. Unit: Kbit/s.

Audio

  • Formats: MP3, WMA, OGG, RA, MIDI, AIF/AIFF, M4A, MKA, and MP2.

  • Duration: allows you to specify the duration range. Unit: seconds.

Semantic content conditions

You can enter semantic content to quickly locate the images, documents, videos, or audio that meet the requirements.

  • Specify custom semantic content that is less than 40 characters in length. Examples: "photos of the Forbidden City in the snow" and "how to use a wireless printer".

  • Limits on semantic content:

    • You cannot specify the Object Sort Order or Data Aggregation parameter.

    • You must select one and only one parameter in the Multimedia Metadata Condition section.

    • You cannot search for objects that are encrypted by using KMS-managed bring-your-own-key (BYOK) keys.

User metadata conditions

You can specify custom metadata in key-value pairs to accurately search for objects.

  • You can specify the User Metadata parameter in key-value pairs. For more information about custom metadata, see Manage object metadata.

  • You can specify up to 20 pieces of custom metadata. Keys and values of custom metadata are required.

Search result settings

You can sort the search results and view statistics on search results based on specific conditions.

  • Object Sort Order: You can sort the search results in the Ascending, Descending, or Default order based on the Last Modified Time, Object Name, and Object Size based on your business requirements.

  • Data Aggregation: You can view statistics on the search results based on specific conditions, such as de-duplication, group count, maximum, minimum, average, and sum. This facilitates efficient data analysis and management.

FAQ

Why am I unable to immediately search for an object after I upload the object?

After you upload an object, a specific amount of time is required to create an index for the object. In this case, the search results cannot ensure strong consistency, and you are unable to immediately search for the object. Wait for several minutes and search for the object again.