Skip to content

Commit c829dad

Browse files
authored
Update vector-search.md
1 parent 8d0da03 commit c829dad

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

articles/cosmos-db/mongodb/vcore/vector-search.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,17 @@ To create a vector index, use the following `createIndexes` template:
5252
| `index_name` | string | Unique name of the index. |
5353
| `path_to_property` | string | Path to the property that contains the vector. This path can be a top-level property or a dot notation path to the property. If a dot notation path is used, then all the nonleaf elements can't be arrays. |
5454
| `kind` | string | Type of vector index to create. Currently, `vector-ivf` is the only supported index option. |
55-
| `numLists` | integer | This integer is the number of clusters that the inverted file (IVF) index uses to group the vector data. We recommend that `numLists` is set to `rowCount()/1000` for up to 1 million rows and to `sqrt(rowCount)` for more than 1 million rows. |
55+
| `numLists` | integer | This integer is the number of clusters that the inverted file (IVF) index uses to group the vector data. We recommend that `numLists` is set to `rowCount()/1000` for up to 1 million rows and to `sqrt(rowCount)` for more than 1 million rows. Using a `numLists` value of `1` is akin to performing brute-force search. |
5656
| `similarity` | string | Similarity metric to use with the IVF index. Possible options are `COS` (cosine distance), `L2` (Euclidean distance), and `IP` (inner product). |
5757
| `dimensions` | integer | Number of dimensions for vector similarity. The maximum number of supported dimensions is `2000`. |
5858

59+
> [!IMPORTANT]
60+
> Setting the _numLists_ parameter correctly is critical to achieving good accuracy and perormance. We recommend that `numLists` is set to `rowCount()/1000` for up to 1 million rows and to `sqrt(rowCount)` for more than 1 million rows.
61+
>
62+
> As the number of items in your database grows, you should tune _numLists_ to be larger in order to achieve good latency performance for vector search.
63+
>
64+
> If you're experimenting with a new scenario or creating a small demo, you can start with `numLists` set to `1` to perform a brute-force search across all vectors. This should provdie you with the most accurate results from the vector search.
65+
5966
## Examples
6067

6168
The following examples show you how to index vectors, add documents that have vector properties, perform a vector search, and retrieve the index configuration.
@@ -77,7 +84,7 @@ db.runCommand({
7784
},
7885
cosmosSearchOptions: {
7986
kind: 'vector-ivf',
80-
numLists: 100,
87+
numLists: 3,
8188
similarity: 'COS',
8289
dimensions: 3
8390
}
@@ -176,7 +183,7 @@ In this example, `vectorIndex` is returned with all the `cosmosSearch` parameter
176183
name: 'vectorSearchIndex',
177184
cosmosSearch: {
178185
kind: 'vector-ivf',
179-
numLists: 100,
186+
numLists: 3,
180187
similarity: 'COS',
181188
dimensions: 3
182189
},

0 commit comments

Comments
 (0)