Whatever message this page gives is out now! Go check it out!
vectorStoreClient.add(item)Parameter | Type | Required | Description |
item | Struct | Yes | The data structure representing the item to store. |
Key | Type | Required | Description |
id | String | No | Unique identifier. If omitted, one may be auto-generated by the provider or CF. |
text | String | Yes | The raw text content of the document. |
vector | Array | No | Array of floats representing the embedding. Required only if no embeddingModel is configured on the client. |
metadata | Struct | No | Key-value pairs for filtering (e.g., category, date). |
<cfscript>
try {
vectorstoreclient = vectorStore({
"provider": "milvus",
"url": "http://your-milvus-host:19530",
"databaseName": "default",
"collectionName": "cf_docs",
"dimension": 768,
"metricType": "COSINE",
"indexType": "HNSW",
"apiKey": "",
"embeddingModel": {
"provider": "ollama",
"modelName": "nomic-embed-text:latest",
"baseUrl": "http://localhost:11434",
"dimension": 768
}
});
writeDump(vectorstoreclient.add({
"text": "ColdFusion is a rapid application development platform.",
"metadata": { "product": "coldfusion", "year": 2025 }
}));
writeDump(vectorstoreclient.search({
"text": "rapid application development",
"minScore": 0.25,
"topK": 5,
"filter": { "year": 2025 }
}));
}
catch (any e) {
writeDump(e);
}
</cfscript>