How to Build a Fast Image Search Service with OpenSearch Vector, MaxCompute, and OSS

This guide walks you through quickly setting up an image search engine without pre‑existing vector data by uploading images to OSS, storing metadata in MaxCompute, and leveraging OpenSearch Vector Search Edition to enable both text‑to‑image and image‑to‑image retrieval.

Alibaba Cloud Big Data AI Platform
Alibaba Cloud Big Data AI Platform
Alibaba Cloud Big Data AI Platform
How to Build a Fast Image Search Service with OpenSearch Vector, MaxCompute, and OSS

Solution Architecture

The article demonstrates building an image search engine using OSS + MaxCompute + OpenSearch Vector Search Edition. Users can upload images, have them vectorized inside OpenSearch, and perform various search modes such as image‑to‑image and text‑to‑image.

Environment Preparation

Create AK and SK – When you first log into the Alibaba Cloud console, you must create an AccessKey (AK) and SecretKey (SK). Both the main account and RAM sub‑accounts can have their own keys.

Create Object Storage Service (OSS)

Enable OSS service.

Create a bucket in the console.

Upload files to the bucket.

In the example, 1,000 images are uploaded to OSS.

Purchase OpenSearch Vector Search Edition Instance

Buy an OpenSearch Vector Search Edition instance and configure it with a single table before it can be used for searching.

Configure Instance

Table name – customizable.

Number of data shards – must be consistent across index tables.

Data update resources – each index provides two free 4‑core 8 GB update resources; extra usage incurs fees.

Scene template – select "Vector: Image Search".

Data processing – choose "Convert raw data to vector data".

After configuring the data source (MaxCompute) and verifying it, proceed to the next step.

Field Configuration

Configure the following fields:

vector_source_image – type STRING, marked as an embedding field; store the OSS image path (e.g., "/test/湖泊.jpg").

vector – type FLOAT, marked as the vector field; the system generates a 512‑dimensional vector automatically.

Important: The value stored in the vector_source_image field must exactly match the OSS image path.

Index Structure Configuration

Vector index name matches the vector field name.

Included fields: primary key, vector field, optional tag fields.

Advanced settings can be left at defaults.

The engine generates 512‑dimensional vectors for images and does not allow dimension changes.

Finalize Creation

Click "Confirm Creation" and monitor the table creation progress in the change history. Once completed, the service is ready for testing.

Query Test

Use the provided query examples (vector query, primary‑key query, filter expression) via the SDK or API to retrieve results. Example response:

{
    "totalCount": 5,
    "result": [
        {"id": 5, "score": 1.103209137916565},
        {"id": 3, "score": 1.1278988122940064},
        {"id": 2, "score": 1.1326735019683838}
    ],
    "totalTime": 242.615
}

The result array contains the returned records.

Additional Resources

Refer to the official documentation for detailed steps on creating AK/SK, OSS setup, purchasing OpenSearch instances, billing, and SDK usage.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Cloud ServicesAIimage searchMaxComputeOpenSearchOSS
Alibaba Cloud Big Data AI Platform
Written by

Alibaba Cloud Big Data AI Platform

The Alibaba Cloud Big Data AI Platform builds on Alibaba’s leading cloud infrastructure, big‑data and AI engineering capabilities, scenario algorithms, and extensive industry experience to offer enterprises and developers a one‑stop, cloud‑native big‑data and AI capability suite. It boosts AI development efficiency, enables large‑scale AI deployment across industries, and drives business value.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.