@@ -73,24 +73,24 @@ You must pass the following parameters to the ``vectorSearch()`` method:
73
73
:header-rows: 1
74
74
75
75
* - Parameter
76
- - Type
77
- - Description
76
+ - Type
77
+ - Description
78
78
79
79
* - ``index``
80
- - ``string``
81
- - Name of the vector search index
80
+ - ``string``
81
+ - Name of the vector search index
82
82
83
83
* - ``path``
84
- - ``string``
85
- - Field that stores vector embeddings
84
+ - ``string``
85
+ - Field that stores vector embeddings
86
86
87
87
* - ``queryVector``
88
- - ``array``
89
- - Vector representation of your query
88
+ - ``array``
89
+ - Vector representation of your query
90
90
91
91
* - ``limit``
92
- - ``int``
93
- - Number of results to return
92
+ - ``int``
93
+ - Number of results to return
94
94
95
95
The following code uses the ``vector`` index created in the preceding
96
96
:ref:`laravel-avs-index` section to perform an Atlas Vector Search query on the
@@ -100,28 +100,28 @@ The following code uses the ``vector`` index created in the preceding
100
100
:copyable: true
101
101
102
102
.. input::
103
- :language: php
103
+ :language: php
104
104
105
- $movies = Book::vectorSearch(
106
- index: 'vector',
107
- path: 'vector_embeddings',
108
- // Vector representation of the query `coming of age`
109
- queryVector: [-0.0016261312, -0.028070757, ...],
110
- limit: 3,
111
- );
105
+ $movies = Book::vectorSearch(
106
+ index: 'vector',
107
+ path: 'vector_embeddings',
108
+ // Vector representation of the query `coming of age`
109
+ queryVector: [-0.0016261312, -0.028070757, ...],
110
+ limit: 3,
111
+ );
112
112
113
113
.. output::
114
- :language: json
115
- :visible: false
116
-
117
- [
118
- { "title": "Sunrising",
119
- "plot": "A shy teenager discovers confidence and new friendships during a transformative summer camp experience."
120
- },
121
- { "title": "Last Semester",
122
- "plot": "High school friends navigate love, identity, and unexpected challenges before graduating together."
123
- }
124
- ]
114
+ :language: json
115
+ :visible: false
116
+
117
+ [
118
+ { "title": "Sunrising",
119
+ "plot": "A shy teenager discovers confidence and new friendships during a transformative summer camp experience."
120
+ },
121
+ { "title": "Last Semester",
122
+ "plot": "High school friends navigate love, identity, and unexpected challenges before graduating together."
123
+ }
124
+ ]
125
125
126
126
You can use the ``vectorSearch()`` method to perform many types of Atlas
127
127
Search queries. Depending on your desired query, you can pass the
@@ -131,26 +131,26 @@ following optional parameters to ``vectorSearch()``:
131
131
:header-rows: 1
132
132
133
133
* - Optional Parameter
134
- - Type
135
- - Description
136
- - Default Value
134
+ - Type
135
+ - Description
136
+ - Default Value
137
137
138
138
* - ``exact``
139
- - ``bool``
140
- - Specifies whether to run an Exact Nearest Neighbor (``true``) or
141
- Approximate Nearest Neighbor (``false``) search
142
- - ``false``
139
+ - ``bool``
140
+ - Specifies whether to run an Exact Nearest Neighbor (``true``) or
141
+ Approximate Nearest Neighbor (``false``) search
142
+ - ``false``
143
143
144
144
* - ``filter``
145
- - ``QueryInterface`` or ``array``
146
- - Specifies a pre-filter for documents to search on
147
- - no filtering
145
+ - ``QueryInterface`` or ``array``
146
+ - Specifies a pre-filter for documents to search on
147
+ - no filtering
148
148
149
149
* - ``numCandidates``
150
- - ``int`` or ``null``
151
- - Specifies the number of nearest neighbors to use during the
152
- search
153
- - ``null``
150
+ - ``int`` or ``null``
151
+ - Specifies the number of nearest neighbors to use during the
152
+ search
153
+ - ``null``
154
154
155
155
.. note::
156
156
0 commit comments