diff --git a/pages/querying/vector-search.mdx b/pages/querying/vector-search.mdx index e7ce04be7..876c06b86 100644 --- a/pages/querying/vector-search.mdx +++ b/pages/querying/vector-search.mdx @@ -73,6 +73,27 @@ The following options apply to both single-store vector indexes (nodes) and vect If resizing fails due to memory limitations, an exception will be thrown. Default value is `2`. - `scalar_kind: string (default=f32)` ➡ The [scalar kind](#scalar-kind) used to store each vector component. Smaller types reduce memory usage but may decrease precision. + +### Using parameters for configuration + +The `WITH CONFIG` map accepts query parameters, both for the whole map and for individual values. This lets a client supply the configuration at query time without rebuilding the Cypher string. + +Pass the entire config as a parameter: + +```cypher +CREATE VECTOR INDEX idx ON :Label(embedding) WITH CONFIG $config; +``` + +with `$config` bound by the client to a map such as `{dimension: 128, capacity: 1000, metric: "cos"}`. + +Or parameterize individual values: + +```cypher +CREATE VECTOR INDEX idx ON :Label(embedding) WITH CONFIG {"dimension": $dim, "capacity": $cap}; +``` + +Both forms work for `CREATE VECTOR INDEX` and `CREATE VECTOR EDGE INDEX`. + ### Using a function for configuration Instead of a static map literal, you can pass a **query module function** that returns the configuration map. This lets you centralize index configurations and reuse them across queries.