create_vector_search_index#
- langchain_mongodb.index.create_vector_search_index(collection: Collection, index_name: str, dimensions: int, path: str, similarity: str, filters: List[str] | None = None, *, wait_until_complete: float | None = None, **kwargs: Any) None [source]#
Experimental Utility function to create a vector search index
- Parameters:
collection (Collection) – MongoDB Collection
index_name (str) – Name of Index
dimensions (int) – Number of dimensions in embedding
path (str) – field with vector embedding
similarity (str) – The similarity score used for the index
filters (List[str]) – Fields/paths to index to allow filtering in $vectorSearch
wait_until_complete (Optional[float]) – If provided, number of seconds to wait until search index is ready.
kwargs (Any) – Keyword arguments supplying any additional options to SearchIndexModel.
- Return type:
None