Skip to content

Commit 23608bc

Browse files
committed
wip
1 parent afa8a80 commit 23608bc

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

source/fundamentals/builders/vector-search.txt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ After you create a vector search index on your vector embeddings, you
5050
can reference this index in your pipeline stage, as shown in the
5151
following section.
5252

53-
Vector Search Examples
54-
~~~~~~~~~~~~~~~~~~~~~~
53+
Vector Search Example
54+
~~~~~~~~~~~~~~~~~~~~~
5555

5656
The following example shows how to build an aggregation pipeline that uses the
5757
``vectorSearch()`` and ``project()`` methods to compute a vector search score:
@@ -62,6 +62,13 @@ The following example shows how to build an aggregation pipeline that uses the
6262
:language: java
6363
:dedent:
6464

65+
.. tip:: Query Vector Type
66+
67+
The preceding example creates an instance of ``BinaryVector`` to
68+
serve as the query vector, but you can also create a ``List`` of
69+
``Double`` instances. However, we recommend that you use the
70+
``BinaryVector`` type to improve storage efficiency.
71+
6572
The following example shows how you can run the aggregation and print
6673
the vector search meta-score from the result of the preceding
6774
aggregation pipeline:

source/includes/fundamentals/code-snippets/builders/AggBuilders.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,8 @@ private void vectorSearchPipeline() {
328328
int limit = 1;
329329

330330
// Create a pre-filter to only search within a subset of documents
331-
VectorSearchOptions options = exactVectorSearchOptions().filter(gte("year", 2016));
331+
VectorSearchOptions options = exactVectorSearchOptions()
332+
.filter(gte("year", 2016));
332333

333334
// Create the vectorSearch pipeline stage
334335
List<Bson> pipeline = asList(

0 commit comments

Comments
 (0)