Whatever message this page gives is out now! Go check it out!

addAll

Last update:
May 18, 2026

Description

Adds multiple items to the vector store. This function is optimized to handle insertions effectively, and manage memory and network limits.

Syntax

vectorStoreClient.addAll(items)

Parameters

Parameter
Type
Required
Description
items
Array
Yes
An array of item structures (see add for struct definition).

Returns

An array of strings containing the IDs of the added items.

Example

<cfscript>
    try{
        vs = VectorStore({
            provider: "inmemory",
            embeddingModel: {
                "provider": "openai",
                "modelName": "text-embedding-3-small",
                "apiKey": "#application.apiKey#"
            }
        });
        vs.addAll([
            {
                "id": "sku-501",
                "text": "Trail runner shoes waterproof breathable size 7–12 black",
                "metadata": { "sku": "sku-501", "category": "footwear", "inStock": true }
            },
            {
                "id": "sku-502",
                "text": "Lightweight hiking boots leather ankle support waterproof",
                "metadata": { "sku": "sku-502", "category": "footwear", "inStock": true }
            }
        ]);

        currentSku = "sku-501";

        similar = vs.search({
            "text": "Trail runner shoes waterproof breathable",
            "topK": 5,
            "minScore": 0.35,
            "filter": {
                "category": "footwear",
                "inStock": true,
                "sku": { "$ne": currentSku }
            }
        });

        writeDump(similar);
    } catch(any e){
        writeOutput("Error initializing VectorStore client:<br><br> ");
        writedump(e.detail);
    }
</cfscript>

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page