---
title: Enable Image Search with PIM
slug: user-documentation/enable-image-search-with-pim
docTags: 
createdAt: 2025-01-23T09:21:12.261Z
---

To enable Image Search in your index, you must create a [product template](docId:3IvOQV3bkRkg-XW876aSh) with a special attribute.&#x20;

:::hint{type="warning"}
This product template does not need to be used in your products it is just to enable the image search feature.
:::

## Create an Attribute with the Next KNN Search Properties and Name

```curl
curl --location 'https://api.upstartcommerce.com/pim/attributes' \
--header 'x-upstart-tenant: TENANT_ID'  \
--header 'x-upstart-site:SITE_ID' \
--header 'Content-Type: application/json' \
--header 'x-upstart-api-key: API_KEY' \
--data '{

    "name": "media_url",
    "typeName": "String",
    "adminDisplayConfiguration": {
        "adminDisplayName": {
            "localizations": {
                "en_us": "attribute for image search"
            }
        },
        "displayGroup": "string",
        "inputType": "text",
        "helperText": {
            "localizations": {
                "en_us": "attribute for image search"
            }
        }
    },
    "displayName": {
        "localizations": {
            "en_us": "attribute for image search"
        }
    },
    "description": {
        "localizations": {
            "en_us": "attribute for image search"
        }
    },
    "searchProperties": {
        "knnVectorSupported": true,
        "indexed": false,
        "knnVectorEmbeddings": {
            "image_model": {
                "dimension": 768,
                "method": {
                    "name": "hnsw",
                    "space_type": "l2",
                    "engine": "faiss"
                }
            }
        }
    },
    "multiValued": false,
    "priority": 0,
    "scope": "PRODUCT",
    "isRequired": false,
    "draft": true
}'
```

## Commit the Attribute

```curl
curl --location 'https://api.upstartcommerce.com/pim/batch/attributes/change-status' \
--header 'x-upstart-tenant: TENANT_ID' \
--header 'x-upstart-site: SITE_ID' \
--header 'Content-Type: application/json' \
--header 'x-upstart-api-key: API_KEY' \
--data '[
    {
        "id": "ATTRIBUTE_ID",
        "status": "COMMIT"
    }
]' 
```

## Create the Product Template with the Attribute and Publish

:::hint{type="info"}
The detailed steps to create a Product Template can be viewed on [How to Create Product Templates](docId:3IvOQV3bkRkg-XW876aSh).&#x20;
:::

1. Go to your UpStart Commerce Portal.
2. Access PIM and then go to [Product Templates](docId:3IvOQV3bkRkg-XW876aSh).
3. Click on **Create Template.**
4. Add a name and description to the product template (for example: To Enable Image Search).
5. Select the **product type.**
6. Click on **Create & Open**, search for the image search attribute and add it to the Product Template.&#x20;
7. Click on **Publish**.
8. Reach out to UpStart Commerce team to reindex your catalog indexes to fully enable image search.&#x20;

