@@ -52,7 +52,7 @@ The ``path`` argument can be either the name of a field (as a string), or a
52
52
53
53
The ``value `` argument must be a string or a :class: `~django.db.models.Value `.
54
54
55
- An optional ``score `` :class: `SearchScoreOption ` argument to tune the
55
+ The optional ``score `` :class: `SearchScoreOption ` argument to tune the
56
56
relevance score.
57
57
58
58
``SearchAutocomplete ``
@@ -92,7 +92,9 @@ Optional arguments:
92
92
``SearchExists ``
93
93
----------------
94
94
95
- Atlas Search expression that matches documents where a field exists.
95
+ .. class :: SearchExists(path, *, score=None)
96
+
97
+ Matches documents where a field exists.
96
98
97
99
This expression uses the :doc: `exists operator <atlas:atlas-search/exists >`
98
100
to check whether the specified path is present in the document. It's useful
@@ -110,14 +112,15 @@ for filtering documents that include (or exclude) optional fields.
110
112
The ``path `` argument specifies the document path to check and can be provided
111
113
as a string or a :class: `~django.db.models.F `.
112
114
113
- An optional :class: `SearchScoreOption ` ``score `` argument can be used to
115
+ The optional :class: `SearchScoreOption ` ``score `` argument can be used to
114
116
modify the relevance score of the result.
115
117
116
118
``SearchIn ``
117
119
------------
118
120
119
- Atlas Search expression that matches documents where a field's value is in a
120
- given list.
121
+ .. class :: SearchIn(path, value, *, score=None)
122
+
123
+ Matches documents where a field's value is in a given list.
121
124
122
125
This expression uses the :doc: `in operator <atlas:atlas-search/in >` to match
123
126
documents whose field contains a value from the provided array.
@@ -135,13 +138,15 @@ The ``path`` argument can be the name of a field (as a string) or a
135
138
:class: `~django.db.models.F `. The ``value `` must be a list
136
139
of values or a :class: `~django.db.models.Value `.
137
140
138
- An optional ``score `` :class: `SearchScoreOption ` argument to tune the
141
+ The optional ``score `` :class: `SearchScoreOption ` argument to tune the
139
142
relevance score.
140
143
141
144
``SearchPhrase ``
142
145
----------------
143
146
144
- Atlas Search expression that matches a phrase in the specified field.
147
+ .. class :: SearchPhrase(path, query, *, slop=None, synonyms=None, score=None)
148
+
149
+ Matches a phrase in the specified field.
145
150
146
151
This expression uses the :doc: `phrase operator <atlas:atlas-search/phrase >` to
147
152
find exact or near-exact sequences of terms. It supports optional slop
@@ -171,7 +176,9 @@ Optional arguments:
171
176
``SearchQueryString ``
172
177
---------------------
173
178
174
- Atlas Search expression that matches using a Lucene-style query string.
179
+ .. class :: SearchQueryString(path, query, *, score=None)
180
+
181
+ Matches using a Lucene-style query string.
175
182
176
183
This expression uses the
177
184
:doc: `queryString operator <atlas:atlas-search/queryString >` to parse and
@@ -193,14 +200,15 @@ The ``path`` argument can be a string or a
193
200
:class: `~django.db.models.F ` representing the field to query.
194
201
The ``query `` argument is a Lucene-style query string.
195
202
196
- An optional ``score `` :class: `SearchScoreOption ` argument to tune the
203
+ The optional ``score `` :class: `SearchScoreOption ` argument to tune the
197
204
relevance score.
198
205
199
206
``SearchRange ``
200
207
---------------
201
208
202
- Atlas Search expression that filters documents within a specified range of
203
- values.
209
+ .. class :: SearchRange(path, *, lt=None, lte=None, gt=None, gte=None, score=None)
210
+
211
+ Filters documents within a specified range of values.
204
212
205
213
This expression uses the :doc: `range operator <atlas:atlas-search/range >` to
206
214
match numeric, date, or other comparable fields based on upper and/or lower
@@ -229,7 +237,9 @@ Optional arguments:
229
237
``SearchRegex ``
230
238
---------------
231
239
232
- Atlas Search expression that matches string fields using a regular expression.
240
+ .. class :: SearchRegex(path, query, *, allow_analyzed_field=None, score=None)
241
+
242
+ Matches string fields using a regular expression.
233
243
234
244
This expression uses the :doc: `regex operator <atlas:atlas-search/regex >` to
235
245
apply a regular expression pattern to the contents of a specified field.
@@ -256,8 +266,10 @@ Optional arguments:
256
266
``SearchText ``
257
267
--------------
258
268
259
- Atlas Search expression that performs full-text search using the :doc: `text
260
- operator <atlas:atlas-search/text>`.
269
+ .. class :: SearchText(path, query, *, fuzzy=None, match_criteria=None,
270
+ synonyms=None, score=None)
271
+
272
+ Performs full-text search using the :doc: `text operator <atlas:atlas-search/text >`.
261
273
262
274
This expression matches terms in the specified field and supports fuzzy
263
275
matching, match criteria, and synonym mappings.
@@ -291,7 +303,9 @@ Optional arguments:
291
303
``SearchWildcard ``
292
304
------------------
293
305
294
- Atlas Search expression that matches strings using wildcard patterns.
306
+ .. class :: SearchWildcard(path, query, allow_analyzed_field=None, score=None)
307
+
308
+ Matches strings using wildcard patterns.
295
309
296
310
This expression uses the
297
311
:doc: `wildcard operator <atlas:atlas-search/wildcard >` to search for terms
@@ -322,8 +336,9 @@ Optional arguments:
322
336
``SearchGeoShape ``
323
337
------------------
324
338
325
- Atlas Search expression that filters documents based on spatial relationships
326
- with a geometry.
339
+ .. class :: SearchGeoShape(path, relation, geometry, *, score=None)
340
+
341
+ Filters documents based on spatial relationships with a geometry.
327
342
328
343
This expression uses the
329
344
:doc: `geoShape operator <atlas:atlas-search/geoShape >` to match documents
@@ -351,14 +366,15 @@ Required arguments:
351
366
``"within" ``, ``"intersects" ``, and ``"disjoint" ``.
352
367
- ``geometry ``: A GeoJSON geometry object to compare against.
353
368
354
- An optional ``score `` :class: `SearchScoreOption ` argument to tune the
369
+ The optional ``score `` :class: `SearchScoreOption ` argument to tune the
355
370
relevance score.
356
371
357
372
``SearchGeoWithin ``
358
373
-------------------
359
374
360
- Atlas Search expression that filters documents with geo fields contained
361
- within a specified shape.
375
+ .. class :: SearchGeoWithin(path, kind, geometry, *, score=None)
376
+
377
+ Filters documents with geo fields contained within a specified shape.
362
378
363
379
This expression uses the
364
380
:doc: `geoWithin operator <atlas:atlas-search/geoWithin >` to match documents
@@ -384,17 +400,19 @@ Required arguments:
384
400
- ``kind ``: The GeoJSON geometry type ``circle ``, ``box ``, or ``geometry ``.
385
401
- ``geo_object ``: The GeoJSON geometry defining the spatial boundary.
386
402
387
- An optional ``score `` :class: `SearchScoreOption ` argument to tune the
403
+ The optional ``score `` :class: `SearchScoreOption ` argument to tune the
388
404
relevance score.
389
405
390
406
``SearchMoreLikeThis ``
391
407
----------------------
392
408
393
- Atlas Search expression that finds documents similar to the provided examples.
409
+ .. class :: SearchMoreLikeThis( documents, *, score=None)
394
410
395
- This expression uses the
396
- :doc: `moreLikeThis operator <atlas:atlas-search/morelikethis >` to retrieve
397
- documents that resemble one or more example documents.
411
+ Finds documents similar to the provided examples.
412
+
413
+ This expression uses the :doc: `moreLikeThis operator
414
+ <atlas:atlas-search/morelikethis>` to retrieve documents that resemble one
415
+ or more example documents.
398
416
399
417
.. code-block :: pycon
400
418
@@ -413,12 +431,15 @@ documents that resemble one or more example documents.
413
431
The ``documents `` argument must be a list of example documents or expressions
414
432
that serve as references for similarity.
415
433
416
- An optional ``score `` :class: `SearchScoreOption ` argument to tune the
434
+ The optional ``score `` :class: `SearchScoreOption ` argument to tune the
417
435
relevance score.
418
436
419
437
``CompoundExpression ``
420
438
======================
421
439
440
+ .. class :: CompoundExpression(*, must=None, must_not=None, should=None,
441
+ filter=None, score=None, minimum_should_match=None)
442
+
422
443
Compound expression that combines multiple search clauses using boolean logic.
423
444
424
445
This expression uses the :doc: `compound operator <atlas:atlas-search/compound >`
@@ -522,8 +543,11 @@ with other compound expressions.
522
543
``SearchVector ``
523
544
================
524
545
525
- Atlas Search expression that performs vector similarity search using the
526
- :doc: `$vectorSearch stage <atlas:atlas-vector-search/vector-search-stage >`.
546
+ .. class :: SearchVector(path, query_vector, limit, *, num_candidates=None,
547
+ exact=None, filter=None)
548
+
549
+ Performs vector similarity search using the :doc: `$vectorSearch stage
550
+ <atlas:atlas-vector-search/vector-search-stage>`.
527
551
528
552
This expression retrieves documents whose vector field is most similar to a
529
553
given query vector, using either approximate or exact nearest-neighbor search.
@@ -566,6 +590,8 @@ cannot be nested or composed.
566
590
``SearchScoreOption ``
567
591
=====================
568
592
593
+ .. class :: SearchScoreOption(definitions=None)
594
+
569
595
Expression used to control or mutate the relevance score in an Atlas Search
570
596
expression.
571
597
0 commit comments