diff --git a/config/redirects b/config/redirects index 5175739e5..25143c9eb 100644 --- a/config/redirects +++ b/config/redirects @@ -1,6 +1,6 @@ define: prefix docs/drivers/java/sync define: base https://www.mongodb.com/${prefix} -define: versions v4.3 v4.4 v4.5 v4.6 v4.7 v4.8 v4.9 v4.10 v4.11 v5.0 v5.1 master +define: versions v4.3 v4.4 v4.5 v4.6 v4.7 v4.8 v4.9 v4.10 v4.11 v5.0 v5.1 v5.2 master raw: ${prefix}/ -> ${base}/current/ raw: ${prefix}/master -> ${base}/upcoming/ diff --git a/snooty.toml b/snooty.toml index 34d73d260..ef5528a24 100644 --- a/snooty.toml +++ b/snooty.toml @@ -20,8 +20,8 @@ sharedinclude_root = "https://raw.githubusercontent.com/10gen/docs-shared/main/" driver = "java" driver-long = "MongoDB Java Driver" driver-short = "Java driver" -version = "5.1" -full-version = "{+version+}.4" +version = "5.2" +full-version = "{+version+}.0" mdb-server = "MongoDB Server" package-name-org = "mongodb-org" api = "https://mongodb.github.io/mongo-java-driver/{+version+}" diff --git a/source/fundamentals/builders/aggregates.txt b/source/fundamentals/builders/aggregates.txt index 9c150bb50..c26983249 100644 --- a/source/fundamentals/builders/aggregates.txt +++ b/source/fundamentals/builders/aggregates.txt @@ -992,7 +992,8 @@ Atlas Vector Search :atlas:`Limitations ` in the MongoDB Atlas documentation. -Use the ``vectorSearch()`` method to create a :atlas:`$vectorSearch ` +Use the ``vectorSearch()`` method to create a :atlas:`$vectorSearch +` pipeline stage that specifies a **semantic search**. A semantic search is a type of search which locates information that is similar in meaning. @@ -1000,7 +1001,8 @@ To use this feature, you must set up a vector search index and index your vector embeddings. To learn about how to programmatically create a vector search index, see the :ref:`java-search-indexes` section in the Indexes guide. To learn more about vector embeddings, see -:atlas:`How to Index Vector Embeddings for Vector Search `. +:atlas:`How to Index Vector Embeddings for Vector Search +`. The following example shows how to build an aggregation pipeline that uses the ``vectorSearch()`` and ``project()`` methods to compute a vector search score: @@ -1020,5 +1022,7 @@ preceding aggregation pipeline: :language: java :dedent: -Learn more about this helper from the -`vectorSearch() <{+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,long)>`__ API documentation. +Learn more about this helper in the +`vectorSearch() +<{+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)>`__ +API documentation. diff --git a/source/fundamentals/indexes.txt b/source/fundamentals/indexes.txt index 7fcdcb85c..633480db1 100644 --- a/source/fundamentals/indexes.txt +++ b/source/fundamentals/indexes.txt @@ -257,6 +257,11 @@ The following code example shows how to create an Atlas Search index: :start-after: start create-search-index :end-before: end create-search-index +To create multiple Search or Vector Search indexes, you must create a +`SearchIndexModel +<{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/SearchIndexModel.html>`__ +instance for each index. + The following code example shows how to create Search and Vector Search indexes in one call: diff --git a/source/includes/fundamentals/code-snippets/SearchIndexMethods.java b/source/includes/fundamentals/code-snippets/SearchIndexMethods.java index b3ea68f99..74a7ce1dd 100644 --- a/source/includes/fundamentals/code-snippets/SearchIndexMethods.java +++ b/source/includes/fundamentals/code-snippets/SearchIndexMethods.java @@ -2,6 +2,7 @@ import com.mongodb.client.*; import com.mongodb.client.model.SearchIndexModel; +import com.mongodb.client.model.SearchIndexType; import org.bson.Document; import java.util.Arrays; diff --git a/source/includes/fundamentals/code-snippets/builders/AggBuilders.java b/source/includes/fundamentals/code-snippets/builders/AggBuilders.java index 0d1612dac..9eef15a05 100644 --- a/source/includes/fundamentals/code-snippets/builders/AggBuilders.java +++ b/source/includes/fundamentals/code-snippets/builders/AggBuilders.java @@ -7,7 +7,7 @@ import static com.mongodb.client.model.Sorts.*; import static com.mongodb.client.model.Accumulators.*; import static com.mongodb.client.model.search.SearchPath.fieldPath; -import static com.mongodb.client.model.search.VectorSearchOptions.vectorSearchOptions; +import static com.mongodb.client.model.search.VectorSearchOptions.exactVectorSearchOptions; import static java.util.Arrays.asList; // end static import @@ -317,16 +317,14 @@ private void vectorSearchPipeline() { List queryVector = (asList(-0.0072121937, -0.030757688, -0.012945653)); String indexName = "mflix_movies_embedding_index"; FieldSearchPath fieldSearchPath = fieldPath("plot_embedding"); - int numCandidates = 2; int limit = 1; - VectorSearchOptions options = vectorSearchOptions().filter(gte("year", 2016)); + VectorSearchOptions options = exactVectorSearchOptions().filter(gte("year", 2016)); List pipeline = asList( vectorSearch( fieldSearchPath, queryVector, indexName, - numCandidates, limit, options), project( diff --git a/source/includes/language-compatibility-table-java.rst b/source/includes/language-compatibility-table-java.rst index 97695e11b..96bc05532 100644 --- a/source/includes/language-compatibility-table-java.rst +++ b/source/includes/language-compatibility-table-java.rst @@ -12,7 +12,7 @@ - Java 6 - Java 5 - * - 5.1 + * - 4.11 to 5.2 - ✓ - ✓ - ✓ @@ -21,70 +21,7 @@ - - - * - 5.0 - - ✓ - - ✓ - - ✓ - - ✓ - - - - - - - - * - 4.11 - - ✓ - - ✓ - - ✓ - - ✓ - - - - - - - - * - 4.10 - - ✓ [#virtual-threads-note]_ - - ✓ - - ✓ - - ✓ - - - - - - - - * - 4.9 - - ✓ [#virtual-threads-note]_ - - ✓ - - ✓ - - ✓ - - - - - - - - * - 4.8 - - ✓ [#virtual-threads-note]_ - - ✓ - - ✓ - - ✓ - - - - - - - - * - 4.7 - - ✓ [#virtual-threads-note]_ - - ✓ - - ✓ - - ✓ - - - - - - - - * - 4.6 - - ✓ [#virtual-threads-note]_ - - ✓ - - ✓ - - ✓ - - - - - - - - * - 4.5 + * - 4.7 to 4.10 - ✓ [#virtual-threads-note]_ - ✓ - ✓ @@ -93,139 +30,4 @@ - - - * - 4.4 - - - - ✓ - - ✓ - - ✓ - - - - - - - - * - 4.3 - - - - - - ✓ - - ✓ - - - - - - - - * - 4.2 - - - - - - ✓ - - ✓ - - - - - - - - * - 4.1 - - - - - - ✓ - - ✓ - - - - - - - - * - 4.0 - - - - - - ✓ - - ✓ - - - - - - - - * - 3.12 - - - - - - ✓ - - ✓ - - ✓ - - ✓ - - - - * - 3.11 - - - - - - ✓ - - ✓ - - ✓ - - ✓ - - - - * - 3.10 - - - - - - ✓ - - ✓ - - ✓ - - ✓ - - - - * - 3.9 - - - - - - ✓ - - ✓ - - ✓ - - ✓ - - - - * - 3.8 - - - - - - ✓ - - ✓ - - ✓ - - ✓ - - - - * - 3.4 - - - - - - ✓ - - ✓ - - ✓ - - ✓ - - - - * - 3.3 - - - - - - ✓ - - ✓ - - ✓ - - ✓ - - - - * - 3.2 - - - - - - ✓ - - ✓ - - ✓ - - ✓ - - - - * - 3.1 - - - - - - ✓ - - ✓ - - ✓ - - ✓ - - - - * - 3.0 - - - - - - ✓ - - ✓ - - ✓ - - ✓ - - - .. [#virtual-threads-note] This driver version is not compatible with virtual threads. \ No newline at end of file diff --git a/source/includes/mongodb-compatibility-table-java.rst b/source/includes/mongodb-compatibility-table-java.rst index 9c66f3d56..8fc2047fc 100644 --- a/source/includes/mongodb-compatibility-table-java.rst +++ b/source/includes/mongodb-compatibility-table-java.rst @@ -13,10 +13,6 @@ - MongoDB 4.2 - MongoDB 4.0 - MongoDB 3.6 - - MongoDB 3.4 - - MongoDB 3.2 - - MongoDB 3.0 - - MongoDB 2.6 * - 5.2 - ✓ @@ -28,56 +24,8 @@ - ✓ - ✓ - ✓ - - - - - - - - - * - 5.1 - - ⊛ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - - - - - - - - - * - 5.0 - - ⊛ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - - - - - - - - - * - 4.11 - - ⊛ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - - - - - - - - * - 4.10 + * - 4.10 to 5.1 - ⊛ - ✓ - ✓ @@ -87,12 +35,8 @@ - ✓ - ✓ - ✓ - - - - - - - - - * - 4.9 + * - 4.8 to 4.9 - ⊛ - ⊛ - ✓ @@ -102,25 +46,7 @@ - ✓ - ✓ - ✓ - - - - - - - - - * - 4.8 - - ⊛ - - ⊛ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - - - - - - - * - 4.7 - ⊛ - ⊛ @@ -131,287 +57,3 @@ - ✓ - ✓ - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - * - 4.6 - - ⊛ - - ⊛ - - ⊛ - - ⊛ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - * - 4.5 - - ⊛ - - ⊛ - - ⊛ - - ⊛ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - * - 4.4 - - ⊛ - - ⊛ - - ⊛ - - ⊛ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - * - 4.3 - - ⊛ - - ⊛ - - ⊛ - - ⊛ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - * - 4.2 - - ⊛ - - ⊛ - - ⊛ - - ⊛ - - ⊛ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - * - 4.1 - - ⊛ - - ⊛ - - ⊛ - - ⊛ - - ⊛ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - * - 4.0 - - ⊛ - - ⊛ - - ⊛ - - ⊛ - - ⊛ - - ⊛ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - * - 3.12 - - ⊛ - - ⊛ - - ⊛ - - ⊛ - - ⊛ - - ⊛ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - * - 3.11 - - ⊛ - - ⊛ - - ⊛ - - ⊛ - - ⊛ - - ⊛ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - * - 3.10 - - ⊛ - - ⊛ - - ⊛ - - ⊛ - - ⊛ - - ⊛ - - ⊛ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - * - 3.9 - - ⊛ - - ⊛ - - ⊛ - - ⊛ - - ⊛ - - ⊛ - - ⊛ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - * - 3.8 - - ⊛ - - ⊛ - - ⊛ - - ⊛ - - ⊛ - - ⊛ - - ⊛ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - * - 3.7 - - - - - - - - - - - - - - - - - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - * - 3.6 - - - - - - - - - - - - - - - - - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - * - 3.5 - - - - - - - - - - - - - - - - - - - - ✓ - - ✓ - - ✓ - - ✓ - * - 3.4 - - - - - - - - - - - - - - - - - - - - ✓ - - ✓ - - ✓ - - ✓ - * - 3.3 - - - - - - - - - - - - - - - - - - - - - - ✓ - - ✓ - - ✓ - * - 3.2 - - - - - - - - - - - - - - - - - - - - - - ✓ - - ✓ - - ✓ - * - 3.1 - - - - - - - - - - - - - - - - - - - - - - - - ✓ - - ✓ - * - 3.0 - - - - - - - - - - - - - - - - - - - - - - - - ✓ - - ✓ diff --git a/source/whats-new.txt b/source/whats-new.txt index f9c4b6aa1..be7f7d4f0 100644 --- a/source/whats-new.txt +++ b/source/whats-new.txt @@ -47,9 +47,9 @@ What's New in 5.2 New features of the 5.2 driver release include: -- A forward-slash (``/``) character between the host names and client options in a - connection URI is optional. The driver parses the following connection URI - examples in the same way: +- A forward-slash (``/``) character between the host names and client + options in a connection URI is optional. The driver parses the + following connection URI examples in the same way: .. code-block:: java @@ -63,8 +63,12 @@ New features of the 5.2 driver release include: .. replacement:: avs-index-link - :ref:`java-search-indexes` in the Indexes guide + :ref:`java-search-indexes` in the Indexes guide + .. replacement:: vector-search-link + + :ref:`java-atlas-vector-search` in the Aggregates Builders guide + .. _java-version-5.1.3: What's New in 5.1.3