@@ -77,7 +77,7 @@ in a MongoDB Atlas Search index.
77
77
78
78
- ``path ``: The document path to the field.
79
79
- ``query ``: The value to match.
80
- - ``fuzzy ``: Fuzzy matching options, e.g., ``{"maxEdits": 1} ``.
80
+ - ``fuzzy ``: A dictionary of fuzzy matching options, e.g., ``{"maxEdits": 1} ``.
81
81
- ``token_order ``: Controls token sequence behavior. Accepts values like
82
82
``"sequential" `` or ``"any" ``.
83
83
- ``score ``: A :class: `SearchScoreOption ` to tune the relevance score.
@@ -226,7 +226,7 @@ date, or other comparable fields based on upper and/or lower bounds.
226
226
227
227
Matches string fields using a regular expression.
228
228
229
- Uses the :doc: `regex operator <atlas:atlas-search/regex >` to apply a regular
229
+ Uses the :doc: `regex operator <atlas:atlas-search/regex >` to match a regular
230
230
expression pattern to the contents of a specified field.
231
231
232
232
.. code-block :: pycon
@@ -241,10 +241,9 @@ expression pattern to the contents of a specified field.
241
241
**Arguments: **
242
242
243
243
- ``path ``: The document path to the field.
244
- - ``query ``: Regular expression string that will be applied to the field
245
- contents.
246
- - ``allow_analyzed_field ``: Boolean indicating whether to allow matching
247
- against analyzed fields.
244
+ - ``query ``: The regular expression to match.
245
+ - ``allow_analyzed_field ``: Boolean indicating whether to match against an
246
+ analyzed field. ``False `` if not specified.
248
247
- ``score ``: A :class: `SearchScoreOption ` to tune the relevance score.
249
248
250
249
``SearchText ``
@@ -255,8 +254,8 @@ expression pattern to the contents of a specified field.
255
254
Performs full-text search using the :doc: `text operator
256
255
<atlas:atlas-search/text>`.
257
256
258
- Matches terms in the specified field and supports fuzzy matching, match
259
- criteria, and synonym mappings.
257
+ Matches terms in the specified field. Supports fuzzy matching, match criteria,
258
+ and synonym mappings.
260
259
261
260
.. code-block :: pycon
262
261
@@ -274,9 +273,8 @@ criteria, and synonym mappings.
274
273
**Arguments: **
275
274
276
275
- ``path ``: The document path to the field.
277
- - ``query ``: The argument is the search term or phrase.
278
- - ``fuzzy ``: A dictionary of fuzzy matching options, such as
279
- ``{"maxEdits": 1} ``.
276
+ - ``query ``: The search term or phrase.
277
+ - ``fuzzy ``: A dictionary of fuzzy matching options, e.g., ``{"maxEdits": 1} ``.
280
278
- ``match_criteria ``: Whether to match ``"all" `` or ``"any" `` terms (defaults
281
279
to Atlas Search behavior).
282
280
- ``synonyms ``: The name of a synonym mapping defined in your Atlas index.
@@ -308,8 +306,8 @@ single character) wildcards.
308
306
309
307
- ``path ``: The document path to the field.
310
308
- ``query ``: A wildcard string that may include ``* `` and ``? ``.
311
- - ``allow_analyzed_field ``: Boolean indicating whether to allow matching
312
- against analyzed fields .
309
+ - ``allow_analyzed_field ``: Boolean indicating whether to match against an
310
+ analyzed field. `` False `` if not specified .
313
311
- ``score ``: A :class: `SearchScoreOption ` to tune the relevance score.
314
312
315
313
``SearchGeoShape ``
@@ -320,8 +318,8 @@ single character) wildcards.
320
318
Filters documents based on spatial relationships with a geometry.
321
319
322
320
Uses the :doc: `geoShape operator <atlas:atlas-search/geoShape >` to match
323
- documents where a geo field has a specified spatial relation to a given
324
- GeoJSON geometry.
321
+ documents where a geo field has a specified spatial relation to a given GeoJSON
322
+ geometry.
325
323
326
324
.. code-block :: pycon
327
325
@@ -338,8 +336,8 @@ GeoJSON geometry.
338
336
**Arguments: **
339
337
340
338
- ``path ``: The document path to the field.
341
- - ``relation ``: The spatial relation to test. Valid values include
342
- ``"within " ``, ``"intersects" ``, and ``"disjoint " ``.
339
+ - ``relation ``: The spatial relation to test. Valid values are `` "contains" ``,
340
+ ``"disjoint " ``, ``"intersects" ``, and ``"within " ``.
343
341
- ``geometry ``: A GeoJSON geometry object to compare against.
344
342
- ``score ``: A :class: `SearchScoreOption ` to tune the relevance score.
345
343
@@ -359,7 +357,7 @@ geometry.
359
357
>>> from django_mongodb_backend.expressions import SearchGeoWithin
360
358
>>> polygon = {"type": "Polygon", "coordinates": [[[0, 0], [3, 6], [6, 1], [0, 0]]]}
361
359
>>> Article.objects.annotate(
362
- ... score=SearchGeoWithin(path="location", kind="Polygon ", geo_object=polygon)
360
+ ... score=SearchGeoWithin(path="location", kind="geometry ", geo_object=polygon)
363
361
... )
364
362
<QuerySet [
365
363
<Article: title: Local Environmental Impacts Study (location: [2, 3])>,
@@ -369,7 +367,8 @@ geometry.
369
367
**Arguments: **
370
368
371
369
- ``path ``: The document path to the field.
372
- - ``kind ``: The GeoJSON geometry type ``circle ``, ``box ``, or ``geometry ``.
370
+ - ``kind ``: The GeoJSON geometry type: ``"circle" ``, ``"box" ``, or
371
+ ``"geometry" ``.
373
372
- ``geo_object ``: The GeoJSON geometry defining the spatial boundary.
374
373
- ``score ``: A :class: `SearchScoreOption ` to tune the relevance score.
375
374
@@ -399,11 +398,10 @@ retrieve documents that resemble one or more example documents.
399
398
400
399
**Arguments: **
401
400
402
- - ``documents ``: List of example documents or expressions
403
- that serve as references for similarity.
401
+ - ``documents ``: List of example documents or expressions that serve as
402
+ references for similarity.
404
403
- ``score ``: A :class: `SearchScoreOption ` to tune the relevance score.
405
404
406
-
407
405
``CompoundExpression ``
408
406
======================
409
407
@@ -442,9 +440,8 @@ contribute to document matching and scoring.
442
440
match.
443
441
- ``score ``: A :class: `SearchScoreOption ` to tune the relevance score.
444
442
445
-
446
- ``Combinable expressions ``
447
- --------------------------
443
+ Combinable expressions
444
+ ----------------------
448
445
449
446
All Atlas Search expressions subclassed from ``SearchExpression ``
450
447
can be combined using Python's bitwise operators:
@@ -472,8 +469,8 @@ This allows for more expressive and readable search logic:
472
469
Performs vector similarity search using the :doc: `$vectorSearch stage
473
470
<atlas:atlas-vector-search/vector-search-stage>`.
474
471
475
- Retrieves documents whose vector field is most similar to a given query
476
- vector, using either approximate or exact nearest-neighbor search.
472
+ Retrieves documents whose vector field is most similar to a given query vector,
473
+ using either approximate or exact nearest-neighbor search.
477
474
478
475
.. code-block :: pycon
479
476
@@ -495,9 +492,10 @@ vector, using either approximate or exact nearest-neighbor search.
495
492
- ``path ``: The document path to the field.
496
493
- ``query_vector ``: The input vector used for similarity comparison.
497
494
- ``limit ``: The maximum number of matching documents to return.
498
- - ``num_candidates ``: The number of candidate documents considered during
499
- search .
495
+ - ``num_candidates ``: The number of nearest neighbors to use during the search.
496
+ Required if `` exact `` is `` False `` or omitted .
500
497
- ``exact ``: A boolean whether to enforce exact search instead of approximate.
498
+ Required if ``num_candidates `` is omitted. If omitted, defaults to ``False ``.
501
499
- ``filter ``: A MQL filter expression to restrict the candidate documents.
502
500
503
501
.. warning ::
0 commit comments