Skip to content

Commit 8a3ac5a

Browse files
DOCSP-34578 Vector search index (#598)
* DOCSP-34578 vector search index * DOCSP-34578 add ref * DOCSP-34578 nit fix * DOCSP-34578 LT feedback * DOCSP-34578 add note * DOCSP-34578 link to atlas
1 parent 4d3b9e9 commit 8a3ac5a

File tree

2 files changed

+156
-1
lines changed

2 files changed

+156
-1
lines changed

source/indexes.txt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,16 @@ Create an Index
8383
Create an Atlas Search Index
8484
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8585

86-
To create an Atlas Search index, see :ref:`compass-create-search-index`.
86+
Atlas Search indexes let you query data in `Atlas Search
87+
<https://www.mongodb.com/docs/atlas/atlas-search/>`__. For more
88+
information, see :ref:`compass-create-search-index`.
89+
90+
Create an Atlas Vector Search Index
91+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
92+
93+
Atlas Vector Search indexes enable you to index vector data *and* other data
94+
types, which facilitates semantic searches on the indexed fields. For more
95+
information, see :ref:`compass-create-vector-search`.
8796

8897
.. _compass-wildcard-index:
8998

@@ -168,3 +177,4 @@ Limitations
168177
:titlesonly:
169178

170179
/indexes/create-search-index
180+
/indexes/create-vector-search-index
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
.. _compass-create-vector-search:
2+
3+
===================================
4+
Create an Atlas Vector Search Index
5+
===================================
6+
7+
.. contents:: On this page
8+
:local:
9+
:backlinks: none
10+
:depth: 1
11+
:class: singlecol
12+
13+
.. versionadded:: 1.42.1
14+
15+
You can create :atlas:`Atlas Vector Search indexes
16+
</atlas-vector-search/vector-search-overview/>` using |compass|. These indexes
17+
enable you to index vector data *and* other data types, which facilitates
18+
semantic searches on the indexed fields. Atlas Vector Search indexes support
19+
indexing vector data by identifying the most similar vectors. The index
20+
determines similarity by calculating the distance between the query vector
21+
and the vectors stored in the index.
22+
23+
About this Task
24+
---------------
25+
26+
To create an Atlas Search index, your deployment must align with one of the
27+
following cases:
28+
29+
- A deployment hosted on `MongoDB Atlas <https://www.mongodb.com/docs/atlas/>`__ and
30+
have an Atlas cluster tier of M10 or higher.
31+
32+
- A local deployment that is set up using the `Atlas CLI
33+
<https://www.mongodb.com/docs/atlas/cli/stable/atlas-cli-deploy-local/>`__.
34+
35+
Additionally, your deployment must run MongoDB version 7.0 or later.
36+
37+
Steps
38+
-----
39+
40+
.. procedure::
41+
:style: normal
42+
43+
.. step:: Open the index creation dialog
44+
45+
From the :ref:`Indexes <indexes-tab>` tab, click the
46+
:guilabel:`Create` button and then click :guilabel:`Search Index`.
47+
48+
.. step:: Specify a name for the index
49+
50+
.. step:: Select the Atlas Search Index type
51+
52+
Select :guilabel:`Vector Search`.
53+
54+
.. step:: Provide the Atlas Vector Search Index configurations
55+
56+
You must initially provide the following default vector search index
57+
configurations. You can modify the configurations later.
58+
59+
.. list-table::
60+
:header-rows: 1
61+
:widths: 20 10 70
62+
63+
* - Field
64+
- Type
65+
- Description
66+
67+
* - ``path``
68+
- string
69+
- The field name to index.
70+
71+
* - ``numDimensions``
72+
- int
73+
- The number of vector dimensions, which Atlas Search enforces at index- and
74+
query-time. This value can't be greater than 2048.
75+
76+
* - ``similarity``
77+
- string
78+
- The vector similarity function used to search for the top K-nearest neighbors.
79+
Select from the following functions:
80+
81+
.. list-table::
82+
:header-rows: 1
83+
:widths: 50 50
84+
85+
* - Function
86+
- Description
87+
88+
* - ``euclidean``
89+
- A function that measures the distance between ends of vectors. This function
90+
allows you to measure similarity based on varying dimensions.
91+
92+
* - ``cosine``
93+
- A function that measures similarity based on the angle between vectors. This
94+
function allows you to measure similarity that isn't scaled by magnitude.
95+
96+
You can't use zero magnitude vectors with cosine. To measure cosine similarity,
97+
we recommend that you normalize your vectors and use dotProduct instead.
98+
99+
* - ``dotProduct``
100+
- A function that measures similarly to cosine, but takes into account the
101+
magnitude of the vector. This function allows you to efficiently measure
102+
similarity based on both angle and magnitude. To use dotProduct, you must
103+
normalize the vector to unit length at index- and query-time.
104+
105+
.. step:: Click :guilabel:`Create Search Index`
106+
107+
Example
108+
-------
109+
110+
The following example definition uses the ``sample_mflix.embedded_movies`` collection
111+
and indexes the ``plot_embedding`` field to create an Atlas Vector Search index:
112+
113+
.. code-block:: javascript
114+
115+
{
116+
"fields": [ {
117+
"type": "vector",
118+
"path": "plot_embedding",
119+
"numDimensions": 1536,
120+
"similarity": "euclidean"
121+
} ]
122+
}
123+
124+
Results
125+
-------
126+
127+
To view the status of your created index, go to the :guilabel:`Indexes`
128+
tab and set the toggle at the top-right to :guilabel:`Search Indexes`.
129+
130+
The :guilabel:`Status` column indicates the status of the index. When
131+
the status is :guilabel:`Ready`, your index is ready to use.
132+
133+
For more information on search index statuses, see
134+
:ref:`search-index-status`.
135+
136+
Learn More
137+
----------
138+
139+
- :ref:`compass-indexes`
140+
141+
- :atlas:`How to Index Fields for Vector Search
142+
</atlas-vector-search/vector-search-type/#std-label-avs-types-vector-search>`
143+
144+
- :atlas:`How to Perform Semantic Search Against Data in Your Atlas Cluster
145+
</atlas-vector-search/vector-search-tutorial/>`

0 commit comments

Comments
 (0)