-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from mongodb-developer/auto_index_creation_updates
Auto index creation updates
- Loading branch information
Showing
21 changed files
with
74 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 10 additions & 27 deletions
37
docs/60-perform-semantic-search/2-create-vector-index.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,18 @@ | ||
# 👐 Create a vector search index | ||
|
||
To retrieve documents from MongoDB using vector search, you must configure a vector search index on the collection into which you ingested your data. | ||
To retrieve documents from MongoDB using vector search, you must configure a vector search index on the collection into which you ingested your data. The recommended way to do this is via the MongoDB drivers. | ||
|
||
To do this, open the **Database Deployments** page in the Atlas UI and select **Create Index** in the lower right corner under Atlas Search. | ||
Fill in any `<CODE_BLOCK_N>` placeholders and run the cells under the **Step 7: Create a vector search index** section in the notebook to create a vector search index. | ||
|
||
<Screenshot url="https://cloud.mongodb.com" src="img/screenshots/60-perform-semantic-search/1-create-index.png" alt="Select create index" /> | ||
The answers for code blocks in this section are as follows: | ||
|
||
Click the **Create Search Index** button. | ||
|
||
<Screenshot url="https://cloud.mongodb.com" src="img/screenshots/60-perform-semantic-search/2-create-search-index.png" alt="Create search index" /> | ||
|
||
Click **JSON Editor** under Atlas Vector Search to create your index | ||
|
||
<Screenshot url="https://cloud.mongodb.com" src="img/screenshots/60-perform-semantic-search/3-json-editor.png" alt="The 'Create Index' page with the 'JSON Editor' tab highlighted" /> | ||
|
||
|
||
Select the `mongodb_rag_lab` database and the `knowledge` collection, change the index name to `vector_index`, and add the following index definition in the JSON editor: | ||
**CODE_BLOCK_8** | ||
|
||
<details> | ||
<summary>Answer</summary> | ||
<div> | ||
```python | ||
{ | ||
"fields": [ | ||
{ | ||
"type": "vector", | ||
"path": "embedding", | ||
"numDimensions": 384, | ||
"similarity": "cosine" | ||
} | ||
] | ||
} | ||
collection.create_search_index(model=model) | ||
``` | ||
|
||
:::info | ||
The number of dimensions in the index definition is 384 since we are using the [gte-small](https://huggingface.co/thenlper/gte-small) model to generate embeddings in this lab. | ||
::: | ||
</div> | ||
</details> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.