Whatever message this page gives is out now! Go check it out!
vectorStoreClient.addAll(items)Parameter | Type | Required | Description |
items | Array | Yes | An array of item structures (see add for struct definition). |
<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>