You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/cosmos-db/mongodb/vcore/vector-search.md
+10-3Lines changed: 10 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,10 +52,17 @@ To create a vector index, use the following `createIndexes` template:
52
52
|`index_name`| string | Unique name of the index. |
53
53
|`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. |
54
54
|`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. |
56
56
|`similarity`| string | Similarity metric to use with the IVF index. Possible options are `COS` (cosine distance), `L2` (Euclidean distance), and `IP` (inner product). |
57
57
|`dimensions`| integer | Number of dimensions for vector similarity. The maximum number of supported dimensions is `2000`. |
58
58
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
+
59
66
## Examples
60
67
61
68
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({
77
84
},
78
85
cosmosSearchOptions: {
79
86
kind:'vector-ivf',
80
-
numLists:100,
87
+
numLists:3,
81
88
similarity:'COS',
82
89
dimensions:3
83
90
}
@@ -176,7 +183,7 @@ In this example, `vectorIndex` is returned with all the `cosmosSearch` parameter
0 commit comments