Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOCSP-45930 Atlas Search Query Prep #705

Merged
Merged
Show file tree
Hide file tree
Changes from 5 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
Binary file modified source/images/compass/field-percentage-breakdown.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified source/images/compass/mixed-sample.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified source/images/compass/mixed-sample2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Copy link
Collaborator Author

@ajhuh-mdb ajhuh-mdb Dec 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're restoring this information here, so users on Data Explorer are directed to the correct place to create Search/Vector Search indexes.

Copy link
Collaborator Author

@ajhuh-mdb ajhuh-mdb Dec 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

@ajhuh-mdb ajhuh-mdb Dec 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this link will be swapped out in https://github.com/10gen/cloud-docs/pull/6554 since the change will only pertain to Data Explorer

~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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`.
Copy link
Collaborator Author

@ajhuh-mdb ajhuh-mdb Dec 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the Atlas docs, this ref and the ref above will link to the corresponding Atlas Search & Vector Search Index creation pages.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this link will be swapped out in https://github.com/10gen/cloud-docs/pull/6554 since the change will only pertain to Data Explorer


.. END-COMPASS-ONLY

.. _compass-wildcard-index:

Create a Wildcard Index
Expand Down
58 changes: 33 additions & 25 deletions source/query/atlas-search.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,23 @@ 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.
Atlas Search queries take the form of an :ref:`aggregation pipeline stage
ajhuh-mdb marked this conversation as resolved.
Show resolved Hide resolved
<compass-agg-builder>`. 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
ajhuh-mdb marked this conversation as resolved.
Show resolved Hide resolved
MongoDB 7.0 or later.

Steps
-----
Expand All @@ -25,32 +37,28 @@ Steps
: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
From the :guilabel:`Indexes` tab, click :guilabel:`Search Indexes`.
Hover over the search index you want to use in your query.

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

|compass| switches to the :guilabel:`Aggregations` tab where you
can run your query.

#. Construct your query.
.. step:: Open the aggregation pipeline builder

Click the :guilabel:`Aggregate` button that appears when you hover over
your search index.

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.
ajhuh-mdb marked this conversation as resolved.
Show resolved Hide resolved

.. 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
ajhuh-mdb marked this conversation as resolved.
Show resolved Hide resolved
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
6 changes: 3 additions & 3 deletions source/schema.txt
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ For fields that contain multiple data types,
|compass-short| displays a percentage breakdown of
the various data types across documents. In the example below,
the chart shows the contents of a field called ``phone_no`` in which
81% of documents are of type ``string``, and the remaining 19% are of
type ``number``.
20% of documents are of type ``int32``, and the remaining 80% are of
ajhuh-mdb marked this conversation as resolved.
Show resolved Hide resolved
type ``string``.

.. figure:: /images/compass/field-percentage-breakdown.png
:figwidth: 330px
Expand Down Expand Up @@ -239,7 +239,7 @@ field shows the values that are strings:
:figwidth: 574px
:alt: Example of a field with mixed types

Clicking on the ``number`` type causes the chart to show its numeric
Clicking on the ``int32`` type causes the chart to show its numeric
data:

.. figure:: /images/compass/mixed-sample2.png
Expand Down
Loading