@@ -67,25 +67,30 @@ search query.
67
67
68
68
The following sections demonstrate how to create a BSON binary vector
69
69
for your query vector and how to use your vector search index to run a
70
- vector search query on the ``plot_embedding`` field.
70
+ vector search query by using the ``plot_embedding`` field.
71
71
72
72
Create a BSON Binary Vector
73
73
~~~~~~~~~~~~~~~~~~~~~~~~~~~
74
74
75
- You can create a 1536 dimensional vector to use as the query vector
76
- for you vector search query on the ``plot_embedding`` field.
75
+ In this example, you can create a 1536 dimensional vector to use as the query
76
+ vector for your vector search query on the ``plot_embedding`` field.
77
+ The query searches the ``plot_embedding`` field by using a vector
78
+ embedding for the string "time travel".
77
79
78
- The following example shows how to create a BSON binary vector that you can
79
- use as the query vector:
80
+ The following example shows how to translate this vector embedding to a BSON
81
+ binary vector that you can use as the query vector:
80
82
81
83
.. literalinclude:: /includes/fundamentals/code-snippets/vectorSearchQuery.go
82
84
:language: go
83
85
:start-after: start-binary-vector
84
86
:end-before: end-binary-vector
85
87
:dedent:
86
88
87
- You can also deserialize your query vector back to a BSON vector by using
88
- the ``NewVectorFromBinary()`` method:
89
+ If you need to access a slice of the original vector, you can also deserialize
90
+ your query vector back to a BSON vector.
91
+
92
+ The following example shows how to convert the query vector from a BSON binary
93
+ vector to a BSON vector by using the ``NewVectorFromBinary()`` method:
89
94
90
95
.. literalinclude:: /includes/fundamentals/code-snippets/vectorSearchQuery.go
91
96
:language: go
0 commit comments