@@ -9,7 +9,7 @@ Atlas Search & Vector Search
99 :values: reference
1010
1111.. meta::
12- :keywords: code example, semantic, embeddings
12+ :keywords: code example, semantic, embeddings, text
1313
1414.. contents:: On this page
1515 :local:
@@ -33,8 +33,8 @@ documentation:
3333.. note:: Deployment Compatibility
3434
3535 You can use the Atlas Search and Vector Search features only when
36- connecting to MongoDB Atlas clusters. These features are not available for
37- self-managed deployments.
36+ you connect to MongoDB Atlas clusters. These features are not
37+ available for self-managed deployments.
3838
3939This page describes how to create the appropriate indexes for each type
4040of search and provides examples of how to use the {+odm-short+} to
@@ -71,7 +71,8 @@ builder method and as an Eloquent model method. You can use the
7171collections.
7272
7373You must pass an ``operator`` parameter to the ``search()`` method that
74- is an instance of ``SearchOperatorInterface`` or an array. You can
74+ is an instance of ``SearchOperatorInterface`` or an array that contains
75+ the operator type, field name, and query value. You can
7576create an instance of ``SearchOperatorInterface`` by calling the
7677``Search::text()`` method and passing the field you are
7778querying and your search term or phrase.
@@ -83,8 +84,8 @@ create a ``SearchOperatorInterface`` instance:
8384
8485 use MongoDB\Builder\Search;
8586
86- The following code uses the index created in the preceding
87- :ref:`laravel-as-index` section to perform an Atlas Search query on the
87+ The following code performs an Atlas Search query that searches for the
88+ term ``'dream'`` in the ``title`` field values of documents in the
8889``movies`` collection:
8990
9091.. io-code-block::
@@ -113,16 +114,41 @@ You can use the ``search()`` method to perform many types of Atlas
113114Search queries. Depending on your desired query, you can pass the
114115following optional parameters to ``search()``:
115116
116- - ``index``: ``string``
117- - ``highlight``: ``array``
118- - ``concurrent``: ``bool``
119- - ``count``: ``string``
120- - ``searchAfter``: ``string``
121- - ``searchBefore`` ``string``
122- - ``scoreDetails``: ``bool``
123- - ``sort``: ``array``
124- - ``returnStoredSource``: ``bool``
125- - ``tracking``: ``array``
117+ .. list-table::
118+ :header-rows: 1
119+
120+ * - Parameter
121+ - Type
122+
123+ * - ``index``
124+ - ``string``
125+
126+ * - ``highlight``
127+ - ``array``
128+
129+ * - ``concurrent``
130+ - ``bool``
131+
132+ * - ``count``
133+ - ``string``
134+
135+ * - ``searchAfter``
136+ - ``string``
137+
138+ * - ``searchBefore``
139+ - ``string``
140+
141+ * - ``scoreDetails``
142+ - ``bool``
143+
144+ * - ``sort``
145+ - ``array``
146+
147+ * - ``returnStoredSource``
148+ - ``bool``
149+
150+ * - ``tracking``
151+ - ``array``
126152
127153To learn more about these parameters, see the :atlas:`Fields
128154</atlas-search/aggregation-stages/search/#fields>` section of the
@@ -170,11 +196,23 @@ string ``"jak"`` on the ``title`` field:
170196 "Emily Calling Jake"
171197 ]
172198
173- You can also pass the following parameters to the ``autocomplete()``
199+ You can also pass the following optional parameters to the ``autocomplete()``
174200method to customize the query:
175201
176- - ``fuzzy``: ``bool`` or ``array`` (default: ``false``)
177- - ``tokenOrder``: ``string`` (default: ``'any'``)
202+ .. list-table::
203+ :header-rows: 1
204+
205+ * - Parameter
206+ - Type
207+ - Default Value
208+
209+ * - ``fuzzy``
210+ - ``bool`` or ``array``
211+ - ``false``
212+
213+ * - ``tokenOrder``
214+ - ``string``
215+ - ``'any'``
178216
179217To learn more about these parameters, see the :atlas:`Options
180218</atlas-search/autocomplete/#options>` section of the
@@ -208,12 +246,30 @@ on documents in your collections.
208246
209247You must pass the following parameters to the ``vectorSearch()`` method:
210248
211- - ``index``: Name of the vector search index (type: ``string``)
212- - ``path``: Field that stores vector embeddings (type: ``array`` or ``string``)
213- - ``queryVector``: Vector representation of your query (type: ``array``)
214- - ``limit``: Number of results to return (type: ``int``)
215-
216- The following code uses the index created in the preceding
249+ .. list-table::
250+ :header-rows: 1
251+
252+ * - Parameter
253+ - Type
254+ - Description
255+
256+ * - ``index``
257+ - ``string``
258+ - Name of the vector search index
259+
260+ * - ``path``
261+ - ``array`` or ``string``
262+ - Field that stores vector embeddings
263+
264+ * - ``queryVector``
265+ - ``array``
266+ - Vector representation of your query
267+
268+ * - ``limit``
269+ - ``int``
270+ - Number of results to return
271+
272+ The following code uses the ``vector`` index created in the preceding
217273:ref:`laravel-avs-index` section to perform an Atlas Vector Search query on the
218274``movies`` collection:
219275
@@ -248,11 +304,26 @@ You can use the ``vector()`` method to perform many types of Atlas
248304Search queries. Depending on your desired query, you can pass the
249305following optional parameters to ``search()``:
250306
251- - ``exact``: ``bool`` (default: ``false``)
252- - ``filter``: ``QueryInterface`` or ``array`` (default: no filtering)
253- - ``numCandidates``: ``int`` or ``null`` (default: ``null``)
307+ .. list-table::
308+ :header-rows: 1
309+
310+ * - Parameter
311+ - Type
312+ - Default Value
254313
255- .. tip::
314+ * - ``exact``
315+ - ``bool``
316+ - ``false``
317+
318+ * - ``filter``
319+ - ``QueryInterface`` or ``array``
320+ - no filtering
321+
322+ * - ``numCandidates``
323+ - ``int`` or ``null``
324+ - ``null``
325+
326+ .. note::
256327
257328 To construct a ``QueryInterface`` instance, you must import the
258329 ``MongoDB\Builder\Query`` class into your application.
0 commit comments