Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 42 additions & 36 deletions docs/ref/models/search.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ For the examples in this document, we'll use the following models::

Matches documents where a field is equal to a given value.

Uses the :doc:`equals operator <atlas:atlas-search/equals>` to perform exact
matches on fields indexed in a MongoDB Atlas Search index.
Uses the :doc:`equals operator<atlas:atlas-search/operators-collectors/equals>`
to perform exact matches on fields indexed in a MongoDB Atlas Search index.

.. code-block:: pycon

Expand All @@ -58,9 +58,10 @@ matches on fields indexed in a MongoDB Atlas Search index.

Enables autocomplete behavior on string fields.

Uses the :doc:`autocomplete operator <atlas:atlas-search/autocomplete>` to
match the input query against a field indexed with ``"type": "autocomplete"``
in a MongoDB Atlas Search index.
Uses the :doc:`autocomplete operator
<atlas:atlas-search/operators-collectors/autocomplete>` to match the input
query against a field indexed with ``"type": "autocomplete"`` in a MongoDB
Atlas Search index.

.. code-block:: pycon

Expand All @@ -87,9 +88,9 @@ in a MongoDB Atlas Search index.

Matches documents where a field exists.

Uses the :doc:`exists operator <atlas:atlas-search/exists>` to check whether
the specified path is present in the document. It's useful for filtering
documents that include (or exclude) optional fields.
Uses the :doc:`exists operator<atlas:atlas-search/operators-collectors/exists>`
to check whether the specified path is present in the document. It's useful for
filtering documents that include (or exclude) optional fields.

.. code-block:: pycon

Expand All @@ -112,8 +113,8 @@ documents that include (or exclude) optional fields.

Matches documents where a field's value is in a given list.

Uses the :doc:`in operator <atlas:atlas-search/in>` to match documents whose
field contains a value from the provided array.
Uses the :doc:`in operator <atlas:atlas-search/operators-collectors/in>` to
match documents whose field contains a value from the provided array.

.. code-block:: pycon

Expand All @@ -137,9 +138,9 @@ field contains a value from the provided array.

Matches a phrase in the specified field.

Uses the :doc:`phrase operator <atlas:atlas-search/phrase>` to find exact or
near-exact sequences of terms. It supports optional slop (term distance) and
synonym mappings defined in the Atlas Search index.
Uses the :doc:`phrase operator<atlas:atlas-search/operators-collectors/phrase>`
to find exact or near-exact sequences of terms. It supports optional slop (term
distance) and synonym mappings defined in the Atlas Search index.

.. code-block:: pycon

Expand Down Expand Up @@ -167,9 +168,10 @@ synonym mappings defined in the Atlas Search index.

Matches using a Lucene-style query string.

Uses the :doc:`queryString operator <atlas:atlas-search/queryString>` to parse
and execute full-text queries written in a simplified Lucene syntax. It
supports features like boolean operators, wildcards, and field-specific terms.
Uses the :doc:`queryString operator
<atlas:atlas-search/operators-collectors/queryString>` to parse and execute
full-text queries written in a simplified Lucene syntax. It supports features
like boolean operators, wildcards, and field-specific terms.

.. code-block:: pycon

Expand All @@ -196,8 +198,9 @@ supports features like boolean operators, wildcards, and field-specific terms.

Filters documents within a specified range of values.

Uses the :doc:`range operator <atlas:atlas-search/range>` to match numeric,
date, or other comparable fields based on upper and/or lower bounds.
Uses the :doc:`range operator <atlas:atlas-search/operators-collectors/range>`
to match numeric, date, or other comparable fields based on upper and/or lower
bounds.

.. code-block:: pycon

Expand All @@ -224,8 +227,8 @@ date, or other comparable fields based on upper and/or lower bounds.

Matches string fields using a regular expression.

Uses the :doc:`regex operator <atlas:atlas-search/regex>` to match a regular
expression pattern to the contents of a specified field.
Uses the :doc:`regex operator <atlas:atlas-search/operators-collectors/regex>`
to match a regular expression pattern to the contents of a specified field.

.. code-block:: pycon

Expand All @@ -250,7 +253,7 @@ expression pattern to the contents of a specified field.
.. class:: SearchText(path, query, *, fuzzy=None, match_criteria=None, synonyms=None, score=None)

Performs full-text search using the :doc:`text operator
<atlas:atlas-search/text>`.
<atlas:atlas-search/operators-collectors/text>`.

Matches terms in the specified field. Supports fuzzy matching, match criteria,
and synonym mappings.
Expand Down Expand Up @@ -285,8 +288,9 @@ and synonym mappings.

Matches strings using wildcard patterns.

Uses the :doc:`wildcard operator <atlas:atlas-search/wildcard>` to search for
terms matching a pattern with ``*`` (any sequence of characters) and ``?`` (any
Uses the :doc:`wildcard operator
<atlas:atlas-search/operators-collectors/wildcard>` to search for terms
matching a pattern with ``*`` (any sequence of characters) and ``?`` (any
single character) wildcards.

.. code-block:: pycon
Expand Down Expand Up @@ -315,9 +319,9 @@ single character) wildcards.

Filters documents based on spatial relationships with a geometry.

Uses the :doc:`geoShape operator <atlas:atlas-search/geoShape>` to match
documents where a geo field has a specified spatial relation to a given GeoJSON
geometry.
Uses the :doc:`geoShape operator
<atlas:atlas-search/operators-collectors/geoShape>` to match documents where a
geo field has a specified spatial relation to a given GeoJSON geometry.

.. code-block:: pycon

Expand Down Expand Up @@ -346,9 +350,9 @@ geometry.

Filters documents with geo fields contained within a specified shape.

Uses the :doc:`geoWithin operator <atlas:atlas-search/geoWithin>` to match
documents where the geo field lies entirely within the provided GeoJSON
geometry.
Uses the :doc:`geoWithin operator
<atlas:atlas-search/operators-collectors/geoWithin>` to match documents where
the geo field lies entirely within the provided GeoJSON geometry.

.. code-block:: pycon

Expand Down Expand Up @@ -377,8 +381,9 @@ geometry.

Finds documents similar to the provided examples.

Uses the :doc:`moreLikeThis operator <atlas:atlas-search/morelikethis>` to
retrieve documents that resemble one or more example documents.
Uses the :doc:`moreLikeThis operator
<atlas:atlas-search/operators-collectors/morelikethis>` to retrieve documents
that resemble one or more example documents.

.. code-block:: pycon

Expand Down Expand Up @@ -407,10 +412,11 @@ retrieve documents that resemble one or more example documents.

Compound expression that combines multiple search clauses using boolean logic.

Uses the :doc:`compound operator <atlas:atlas-search/compound>` to combine
sub-expressions with ``must``, ``must_not``, ``should``, and ``filter``
clauses. It enables fine-grained control over how multiple conditions
contribute to document matching and scoring.
Uses the :doc:`compound operator
<atlas:atlas-search/operators-collectors/compound>` to combine sub-expressions
with ``must``, ``must_not``, ``should``, and ``filter`` clauses. It enables
fine-grained control over how multiple conditions contribute to document
matching and scoring.

.. code-block:: pycon

Expand Down Expand Up @@ -537,7 +543,7 @@ The ``search`` lookup

Use the ``search`` lookup on :class:`~django.db.models.CharField` and
:class:`~django.db.models.TextField` to perform full-text searches using the
:doc:`text operator <atlas:atlas-search/text>`:
:doc:`text operator <atlas:atlas-search/operators-collectors/text>`:

.. code-block:: pycon

Expand Down
Loading