Skip to content

Commit 3f72989

Browse files
committed
L2 reorg
1 parent cdca362 commit 3f72989

24 files changed

+122
-15
lines changed

source/atlas-vector-search.txt

Lines changed: 88 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Atlas Vector Search
99
:values: reference
1010

1111
.. meta::
12-
:keywords: full text, text analyzer, meta, pipeline, scoring, Lucene, AI, artificial intelligence
12+
:keywords: full text, text analyzer, meta, pipeline, scoring, Lucene, AI, artificial intelligence, code example, semantic, nearest
1313
:description: Learn about how to use Atlas Vector Search in the {+driver-long+}.
1414

1515
.. contents:: On this page
@@ -18,5 +18,90 @@ Atlas Vector Search
1818
:depth: 2
1919
:class: singlecol
2020

21-
See :atlas:`Atlas Vector Search </atlas-vector-search/vector-search-overview/>`
22-
in the MongoDB Atlas documentation.
21+
Overview
22+
--------
23+
24+
In this guide, you can learn how to use the :atlas:`Atlas Vector Search
25+
</atlas-vector-search/vector-search-overview/>` feature
26+
in the {+driver-short+}. The ``Aggregates`` builders class provides the
27+
the ``vectorSearch()`` helper method that you can use to
28+
create a :atlas:`$vectorSearch </atlas-vector-search/vector-search-stage/>`
29+
pipeline stage. This pipeline stage allows you to perform a **semantic
30+
search** on your documents. A semantic search is a type of search which
31+
locates information that is similar in meaning, but not necessarily
32+
identical, to your provided search term or phrase.
33+
34+
.. important:: Feature Compatibility
35+
36+
To learn what versions of MongoDB Atlas support this feature, see
37+
:atlas:`Limitations </atlas-vector-search/vector-search-stage/#limitations>`
38+
in the MongoDB Atlas documentation.
39+
40+
Perform a Vector Search
41+
-----------------------
42+
43+
To use this feature, you must create a vector search index and index your
44+
vector embeddings. To learn about how to programmatically create a
45+
vector search index, see the :ref:`java-search-indexes` section in the
46+
Indexes guide. To learn more about vector embeddings, see
47+
:atlas:`How to Index Vector Embeddings for Vector Search
48+
</atlas-search/field-types/knn-vector/>` in the Atlas documentation.
49+
50+
After you create a vector search index on your vector embeddings, you
51+
can reference this index in your pipeline stage, as shown in the
52+
following section.
53+
54+
Vector Search Example
55+
~~~~~~~~~~~~~~~~~~~~~
56+
57+
The following example shows how to build an aggregation pipeline that uses the
58+
``vectorSearch()`` and ``project()`` methods to compute a vector search score:
59+
60+
.. literalinclude:: /includes/fundamentals/code-snippets/builders/AggBuilders.java
61+
:start-after: // begin vectorSearch
62+
:end-before: // end vectorSearch
63+
:language: java
64+
:dedent:
65+
66+
.. tip:: Query Vector Type
67+
68+
The preceding example creates an instance of ``BinaryVector`` to
69+
serve as the query vector, but you can also create a ``List`` of
70+
``Double`` instances. However, we recommend that you use the
71+
``BinaryVector`` type to improve storage efficiency.
72+
73+
The following example shows how you can run the aggregation and print
74+
the vector search meta-score from the result of the preceding
75+
aggregation pipeline:
76+
77+
.. literalinclude:: /includes/fundamentals/code-snippets/builders/AggBuilders.java
78+
:start-after: // begin vectorSearch-output
79+
:end-before: // end vectorSearch-output
80+
:language: java
81+
:dedent:
82+
83+
.. tip:: Java Driver Vector Search Examples
84+
85+
Visit the :atlas:`Atlas documentation </atlas-vector-search/tutorials/>`
86+
to find more tutorials on using the {+driver-short+} to perform Atlas
87+
Vector Searches.
88+
89+
API Documentation
90+
-----------------
91+
92+
To learn more about the methods and types mentioned in this
93+
guide, see the following API documentation:
94+
95+
- `Aggregates.vectorSearch()
96+
<{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Aggregates.html#vectorSearch(com.mongodb.client.model.search.FieldSearchPath,java.lang.Iterable,java.lang.String,long,com.mongodb.client.model.search.VectorSearchOptions)>`__
97+
98+
- `FieldSearchPath
99+
<{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/search/FieldSearchPath.html>`__
100+
101+
- `VectorSearchOptions
102+
<{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/search/VectorSearchOptions.html>`__
103+
104+
- `Projections.metaVectorSearchScore()
105+
<{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Projections.html#metaVectorSearchScore(java.lang.String)>`__
106+
107+
- `BinaryVector <{+api+}/apidocs/bson/org/bson/BinaryVector.html>`__

source/connection.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Connection Guide
99
Connect to MongoDB </connection/connect>
1010
Connection Options </connection/connection-options>
1111
MongoClient Settings </connection/mongoclientsettings>
12+
Stable API </connection/stable-api>
1213
Network Compression </connection/network-compression>
1314
SOCKS5 Proxy </connection/socks>
1415
JNDI Datasource </connection/jndi>
File renamed without changes.

source/crud.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ CRUD Operations
1111
Write </crud/write-operations>
1212
Query </crud/query-document>
1313
Compound Operations </crud/compound-operations>
14+
Transactions </crud/transactions>
15+
Builders </crud/builders>
16+
Aggregation </crud/aggregation>
17+
Aggregation Operations </crud/aggregation-expression-operations>
18+
Collations </crud/collations>
19+
Large File Storage with GridFS </crud/gridfs>
1420

1521
CRUD (Create, Read, Update, Delete) operations enable you to work with
1622
data stored in MongoDB.
File renamed without changes.

source/fundamentals/builders.txt renamed to source/crud/builders.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ Builders
66

77
.. toctree::
88

9-
Aggregation </builders/aggregates>
10-
Filters </builders/filters>
11-
Indexes </builders/indexes>
12-
Projection </builders/projections>
13-
Sort </builders/sort>
14-
Update </builders/updates>
9+
Aggregation </crud/builders/aggregates>
10+
Filters </crud/builders/filters>
11+
Indexes </crud/builders/indexes>
12+
Projection </crud/builders/projections>
13+
Sort </crud/builders/sort>
14+
Update </crud/builders/updates>
1515

1616
.. contents:: On this page
1717
:local:

0 commit comments

Comments
 (0)