Skip to content

Commit

Permalink
DOCSP-45930 Atlas Search Query Prep
Browse files Browse the repository at this point in the history
  • Loading branch information
ajhuh-mdb committed Dec 12, 2024
1 parent a5d1105 commit 8ea7a4c
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 31 deletions.
4 changes: 0 additions & 4 deletions source/indexes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ Create an Index

.. include:: /includes/shared/steps/create-index.rst

.. BEGIN-COMPASS-ONLY

Create an Atlas Search Index
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand All @@ -97,8 +95,6 @@ Atlas Vector Search indexes enable you to index vector data *and* other data
types, which facilitates semantic searches on the indexed fields. For more
information, see :ref:`compass-create-vector-search`.

.. END-COMPASS-ONLY

.. _compass-wildcard-index:

Create a Wildcard Index
Expand Down
58 changes: 31 additions & 27 deletions source/query/atlas-search.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,45 +12,49 @@ Run Atlas Search Queries
:depth: 1
:class: singlecol

You can run Atlas Search :pipeline:`$search` and :pipeline:`$searchMeta`
queries from |compass| if you :ref:`created the Atlas Search index
<compass-create-search-index>` for data on the Atlas cluster. You can
also run :pipeline:`$vectorSearch` queries from |compass| if you have an
existing Atlas Vector search index on your data in Atlas.
If you have an existing Atlas Search Index for data on your Atlas cluster, you
can run :pipeline:`$search` and :pipeline:`$searchMeta` queries. If you have an
existing Atlas Vector search index on your data in Atlas, you can also run
:pipeline:`$vectorSearch` queries.

Before You Begin
----------------

Create an :ref:`Atlas Search index <compass-create-search-index>` or an
:ref:`Atlas Vector Search index <compass-create-vector-search>`.

.. note::

You can manage Atlas Search indexes in the |compass-short| UI if your
deployment is local, has an Atlas cluster tier of M10 or larger, and runs
MongoDB 7.0 or later.

Steps
-----

.. procedure::
:style: normal

.. step:: Find the index you want to use in your query

a. From the :guilabel:`Indexes` tab, click :guilabel:`Search Indexes`.
#. Hover over the index you want to use in your query.

.. step:: Run the query

a. Click the :guilabel:`Aggregate` button.

|compass| switches to the :guilabel:`Aggregations` tab where you
can run your query.
#. Construct your query.
From the :guilabel:`Indexes` tab, click :guilabel:`Search Indexes`.
Hover over the search index you want to use in your query. Click the
:guilabel:`Aggregate` button that appears to open the aggregation
pipeline builder.

By default, |compass| selects the :pipeline:`$search` stage for
your query. You can select the :pipeline:`$searchMeta` stage
to use in your query. If you are using a ``vectorSearch`` type
index in your query, you can only use the
:pipeline:`$vectorSearch` stage in your query.
.. step:: Construct your query

If you have an Atlas Search index, add the ``$search`` or
``$searchMeta`` stage to your aggregation pipeline. If you have an
Atlas Vector Search index, add the ``$vectorSearch`` stage.

.. note::
.. note::

The Atlas Search :pipeline:`$search` and :pipeline:`$searchMeta` and
the Atlas Vector Search :pipeline:`$vectorSearch` pipeline stages must
be the first stage in your aggregation pipeline.
The Atlas Search ``$search`` and ``$searchMeta`` and
the Atlas Vector Search ``$vectorSearch`` pipeline stages must
be the first stage in your aggregation pipeline.

#. Click :guilabel:`Run` to run your query.
.. step:: Run your query

Learn More
----------
Expand Down

0 comments on commit 8ea7a4c

Please sign in to comment.