Skip to main content

馃憪 Create a vector search index

To retrieve documents using vector search, you must configure a vector search index on the collection you want to perform vector search against.

Fill in any <CODE_BLOCK_N> placeholders and run the cells under the Step 4: Create a vector search index section in the notebook to create a vector search index.

The answers for code blocks in this section are as follows:

CODE_BLOCK_1

Answer
mongodb_client[DB_NAME][VS_COLLECTION_NAME]

CODE_BLOCK_2

Answer
vs_collection.create_search_index(model=model)

To verify that the index was created, navigate to Search Indexes for the chunked_articles collection.

Navigate to search indexes

The index is ready to use once the status changes from PENDING to READY.

Index ready to use