Skip to content

Commit 59880d8

Browse files
authored
Update vector-search.md
1 parent 1cf1963 commit 59880d8

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

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

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ To perform a vector search, use the `$search` aggregation pipeline stage the que
8282
|`efSearch` |integer |The size of the dynamic candidate list for search (`40` by default). A higher value provides better recall at the cost of speed. |
8383
|`k` |integer |The number of results to return. it should be less than or equal to `efSearch` |
8484

85-
Note that creating an HSNW index with large datasets can result in your Azure Cosmos DB for MongoDB vCore resource running out of memory, or can limit the performance of other operations running on your database. If you encounter such issues, these can be mitigated by scaling your resource to a higher cluster tier, or reducing the size of the dataset.
85+
> [!NOTE]
86+
> Creating an HSNW index with large datasets can result in your Azure Cosmos DB for MongoDB vCore resource running out of memory, or can limit the performance of other operations running on your database. If you encounter such issues, these can be mitigated by scaling your resource to a higher cluster tier, or reducing the size of the dataset.
8687
8788
### Create an vector index using IVF
8889

@@ -161,11 +162,6 @@ use test;
161162

162163
db.createCollection("exampleCollection");
163164

164-
```javascript
165-
use test;
166-
167-
db.createCollection("exampleCollection");
168-
169165
db.runCommand({
170166
"createIndexes": "exampleCollection",
171167
"indexes": [
@@ -204,7 +200,6 @@ db.exampleCollection.insertMany([
204200

205201
Continuing with the last example, create another vector, `queryVector`. Vector search measures the distance between `queryVector` and the vectors in the `contentVector` path of your documents. You can set the number of results that the search returns by setting the parameter `k`, which is set to `2` here. You can also set `efSearch`, which is an integer that controls the size of the candidate vector list. A higher value may improve accuracy, however the search will be slower as a result. This is an optional parameter with a default value of 40.
206202

207-
208203
```javascript
209204
const queryVector = [0.52, 0.28, 0.12];
210205
db.exampleCollection.aggregate([

0 commit comments

Comments
 (0)