From ca069204cc27abc1638a03553c153c9376f0c3d7 Mon Sep 17 00:00:00 2001 From: Diego Freniche Date: Fri, 8 Dec 2023 11:17:09 +0000 Subject: [PATCH] Updated vector's JSON to new Atlas Vector Search format --- docs/7-vector-search/6-create-index.mdx | 70 ++++++++++++------------- 1 file changed, 33 insertions(+), 37 deletions(-) diff --git a/docs/7-vector-search/6-create-index.mdx b/docs/7-vector-search/6-create-index.mdx index 1a08431a..86fa2f9a 100644 --- a/docs/7-vector-search/6-create-index.mdx +++ b/docs/7-vector-search/6-create-index.mdx @@ -21,23 +21,22 @@ This time, you will use the **JSON Editor** to create your index -Select your database and collection, change the index name to `vectorsearch`, and add the following code in the JSON editor: +Select your database and the `books` collection, change the index name to `vectorsearch`, and add the following code in the JSON editor: ```js { - "mappings": { - "dynamic": true, - "fields": { - "embeddings": { - "dimensions": 1408, - "similarity": "cosine", - "type": "knnVector" - } + "type": "vectorSearch", + "fields":[ + { + "type": "vector", + "path": "embeddings", + "numDimensions": 1408, + "similarity": "cosine" } - } + ] } ``` @@ -46,16 +45,15 @@ Select your database and collection, change the index name to `vectorsearch`, an ```js { - "mappings": { - "dynamic": true, - "fields": { - "embeddings": { - "dimensions": 1536, - "similarity": "cosine", - "type": "knnVector" - } + "type": "vectorSearch", + "fields":[ + { + "type": "vector", + "path": "embeddings", + "numDimensions": 1536, + "similarity": "cosine" } - } + ] } ``` @@ -64,16 +62,15 @@ Select your database and collection, change the index name to `vectorsearch`, an ```js { - "mappings": { - "dynamic": true, - "fields": { - "embeddings": { - "dimensions": 1408, - "similarity": "cosine", - "type": "knnVector" - } + "type": "vectorSearch", + "fields":[ + { + "type": "vector", + "path": "embeddings", + "numDimensions": 1408, + "similarity": "cosine" } - } + ] } ``` @@ -82,16 +79,15 @@ Select your database and collection, change the index name to `vectorsearch`, an ```js { - "mappings": { - "dynamic": true, - "fields": { - "embeddings": { - "dimensions": 384, - "similarity": "cosine", - "type": "knnVector" - } + "type": "vectorSearch", + "fields":[ + { + "type": "vector", + "path": "embeddings", + "numDimensions": 384, + "similarity": "cosine" } - } + ] } ```