Skip to content

Commit 2c87778

Browse files
DOCSP-37703 Document how to create indexes with options in Atlas CLI (#340)
* DOCSP-37703 Document how to create indexes with options in Atlas CLI * DOCSP-37703 adds new file for rolling index * DOCSP-37703 updates for SS' feedback
1 parent c251344 commit 2c87778

File tree

5 files changed

+123
-98
lines changed

5 files changed

+123
-98
lines changed

source/atlas-cli-deploy-fts.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,8 +377,8 @@ mode.
377377

378378
.. _atlas-cli-deploy-avs:
379379

380-
Use {+avs+} with a Atlas Deployment
381-
-----------------------------------------------
380+
Use {+avs+} with an Atlas Deployment
381+
------------------------------------------------
382382

383383
Use the ``atlas deployments`` command to work with {+avs+}. To
384384
learn more, see :atlas:`How to Index Vector Embeddings for Vector

source/includes/fact-avs-mdb-version.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.. important::
22

33
To use the {+atlas-cli+} with {+avs+}, you must create an |service|
4-
deployment with MongoDB 7.0.2 or later. If you created a local
4+
deployment with MongoDB 7.0.5 or later. If you created a local
55
|service| deployment with an earlier MongoDB version, you don't get
66
the latest MongoDB version automatically. You must delete the
77
earlier images and deployments. Then you must create a new |service|

source/reference/json.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ you can pass a configuration file when using the {+atlas-cli+} to:
2424
- :ref:`Create a {+df+} database <atlas-dataFederation-create>`.
2525
- :ref:`Create <atlas-alerts-settings-create>` or
2626
:ref:`update an alert configuration <atlas-alerts-settings-update>`.
27+
- :ref:`Create a rolling index <atlas-clusters-indexes-create>` for a cluster.
2728

2829
Usage
2930
-----
@@ -73,6 +74,9 @@ command. The commands you can use include but are not limited to:
7374
* - :ref:`atlas-alerts-settings-update`
7475
- :oas-atlas-op:`Update One Alert Configuration for One Project </updateAlertConfiguration>`
7576

77+
* - :ref:`atlas-clusters-indexes-create`
78+
- :oas-atlas-op:`Create One Rolling Index </createRollingIndex>`
79+
7680
When you run the command in your terminal, specify the ``--file`` option
7781
and provide the path to the |json| configuration file that defines your
7882
desired settings.
@@ -150,6 +154,17 @@ To learn more about alert configuration files, see
150154
:ref:`atlas-cli-alert-config-file`. For a sample file,
151155
see :ref:`example-alert-config-file`.
152156

157+
Rolling Index Configuration File
158+
--------------------------------
159+
160+
To learn more about rolling index configuration files, see
161+
:ref:`atlas-cli-rolling-index-config-file`. For example files, see:
162+
163+
- `Unique indexes <https://github.com/mongodb/mongodb-atlas-cli/blob/master/test/e2e/atlas/data/create_2dspere_index.json>`__
164+
- `Sparse Index <https://github.com/mongodb/mongodb-atlas-cli/blob/master/test/e2e/atlas/data/create_sparse_index.json>`__
165+
- `Partial indexes <https://github.com/mongodb/mongodb-atlas-cli/blob/master/test/e2e/atlas/data/create_partial_index.json>`__
166+
167+
153168
.. toctree::
154169
:titlesonly:
155170

@@ -160,3 +175,4 @@ see :ref:`example-alert-config-file`.
160175
Search Nodes </reference/json/search-nodes-config-file>
161176
Online Archive </reference/json/file-options-online-archive>
162177
Alert </reference/json/alert-config-file>
178+
Rolling Index </reference/json/rolling-index-config-file>
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
.. _atlas-cli-rolling-index-config-file:
2+
3+
================================
4+
Rolling Index Configuration File
5+
================================
6+
7+
.. facet::
8+
:name: genre
9+
:values: tutorial
10+
11+
.. contents:: On this page
12+
:local:
13+
:backlinks: none
14+
:depth: 1
15+
:class: singlecol
16+
17+
.. |atlas-cli command| replace:: :ref:`atlas-clusters-indexes-create`
18+
.. |configuration-file-name| replace:: rolling index configuration
19+
.. |openapi-link| replace:: :oas-atlas-op:`Create One Rolling Index </createRollingIndex>`
20+
.. |action| replace:: create one rolling index
21+
22+
You can use a |configuration-file-name| file to specify the
23+
settings required when you |action| using the {+atlas-cli+}. The
24+
{+atlas-cli+} accepts ``.json`` |configuration-file-name| files.
25+
26+
.. _rolling-index-settings:
27+
28+
Available Settings
29+
------------------
30+
31+
When you |action| using a configuration file, you
32+
can specify any settings that are listed in
33+
|openapi-link| under :guilabel:`Request Body Schema`.
34+
35+
.. seealso:: Title
36+
37+
- `Unique indexes <https://github.com/mongodb/mongodb-atlas-cli/blob/master/test/e2e/atlas/data/create_2dspere_index.json>`__
38+
- `Sparse Index <https://github.com/mongodb/mongodb-atlas-cli/blob/master/test/e2e/atlas/data/create_sparse_index.json>`__
39+
- `Partial indexes <https://github.com/mongodb/mongodb-atlas-cli/blob/master/test/e2e/atlas/data/create_partial_index.json>`__
40+
41+
.. _example-rolling-index-config-file:
42+
43+
Create a Configuration File
44+
---------------------------
45+
46+
Follow these steps to |action| with a configuration file:
47+
48+
.. procedure::
49+
:style: normal
50+
51+
.. step:: Copy the sample request for |openapi-link|.
52+
53+
a. Navigate to the |openapi-link|
54+
section of the |service| Admin API specification.
55+
b. Under :guilabel:`Request samples` on the right side, click
56+
:guilabel:`Expand all`.
57+
c. Click :guilabel:`Copy` to copy the sample request.
58+
59+
.. step:: Create the configuration file.
60+
61+
a. Paste the copied sample request into a text editor and change
62+
the values to reflect your values.
63+
b. Save the file with a ``.json`` extension.
64+
65+
.. step:: Run the |atlas-cli command| command with
66+
the ``--file`` option.
67+
68+
Specify the path to the file you saved with the ``--file`` flag.

source/reference/json/search-index-config-file.txt

Lines changed: 36 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -4,118 +4,59 @@
44
Atlas Search Index Configuration File
55
=====================================
66

7+
.. facet::
8+
:name: genre
9+
:values: tutorial
10+
711
.. contents:: On this page
812
:local:
913
:backlinks: none
1014
:depth: 1
1115
:class: singlecol
1216

13-
You can use an |fts| index configuration file to specify the required
14-
settings for creating a search index using the {+atlas-cli+}. The
15-
{+atlas-cli+} accepts ``.json`` search index configuration files. You
16-
can use the ``.json`` search index configuration file to create the
17-
index for :ref:`cloud <atlas-clusters-search-indexes-create>` and
18-
:ref:`local <atlas-deployments-search-indexes-create>` Atlas
19-
deployments.
17+
.. |atlas-cli command| replace:: :ref:`atlas-clusters-search-indexes-create`
18+
.. |configuration-file-name| replace:: search index configuration
19+
.. |openapi-link| replace:: :oas-atlas-op:`Create One Atlas Search Index </createAtlasSearchIndex>`
20+
.. |action| replace:: create an Atlas Search index
21+
22+
You can use a |configuration-file-name| file to specify the
23+
settings required when you |action| using the {+atlas-cli+}. The
24+
{+atlas-cli+} accepts ``.json`` |configuration-file-name| files.
2025

2126
.. _search-index-settings:
2227

23-
Atlas Search Index Settings
24-
---------------------------
28+
Available Settings
29+
------------------
2530

26-
You can specify the following settings in the |fts| index
27-
configuration file. For a full list of available settings, see
28-
the request body schema in the API specification:
29-
:oas-atlas-op:`Create One Atlas Search Index </createAtlasSearchIndex>`.
30-
31-
.. list-table::
32-
:header-rows: 1
33-
:widths: 20 10 70
34-
35-
* - Field
36-
- Type
37-
- Description
38-
39-
* - ``collectionName``
40-
- string
41-
- Label that identifies the collection for which you want to
42-
create an |fts| index.
43-
44-
* - ``database``
45-
- string
46-
- Label that identifies the database that contains the collection
47-
for which you want to create an |fts| index.
48-
49-
* - ``name``
50-
- string
51-
- Label that identifies this index. Within each namespace, names
52-
of all indexes in the namespace must be unique.
53-
54-
* - ``mappings``
55-
- object
56-
- Index specifications for the collection's fields.
57-
58-
* - ``mappings.dynamic``
59-
- boolean
60-
- Flag that indicates whether the index uses dynamic or static
61-
mappings. If omitted or if set to ``false``, ``mappings.fields`` is required. To learn more, see
62-
:atlas:`Atlas Search Index Syntax
63-
</atlas-search/index-definitions/>`.
31+
When you |action| using a configuration file, you
32+
can specify any settings that are listed in
33+
|openapi-link| under :guilabel:`Request Body Schema`.
6434

6535
.. _example-search-index-config-file:
6636

67-
Example Atlas Search Index Configuration File
68-
---------------------------------------------
69-
70-
To create an |fts| index, define the search index in your |json| file as
71-
shown in the following example file:
72-
73-
.. tabs::
74-
75-
.. tab:: Basic Configuration
76-
:tabid: basic
77-
78-
The following configuration automatically indexes all dynamically
79-
indexable fields in the ``sample_airbnb.listingsAndReviews`` collection.
80-
81-
.. literalinclude:: /includes/create-atlas-search-index-config-file.json
82-
83-
.. tab:: Expanded Configuration
84-
:tabid: expanded
85-
86-
The following configuration indexes only the ``name`` and
87-
``property_type`` fields in the
88-
``sample_airbnb.listingsAndReviews`` collection.
89-
90-
.. literalinclude:: /includes/create-atlas-search-expanded-index-config-file.json
91-
92-
Example Atlas Search Index Create Command
93-
-----------------------------------------
94-
95-
.. tabs::
96-
97-
.. tab:: Cloud Deployment
98-
:tabid: cloud
37+
Create a Configuration File
38+
---------------------------
9939

100-
After you create the file, run the command to create the |fts|
101-
search index and specify the ``clusterName`` and the ``file``. The
102-
following example creates a search index for the cluster named
103-
``myCluster`` using a JSON index configuration file named
104-
``search-config.json``:
40+
Follow these steps to |action| with a configuration file:
10541

106-
.. code-block::
42+
.. procedure::
43+
:style: normal
10744

108-
atlas clusters search indexes create --clusterName myCluster --file search-config.json --output json
45+
.. step:: Copy the sample request for |openapi-link|.
10946

110-
.. tab:: Local Deployment
111-
:tabid: local
47+
a. Navigate to the |openapi-link|
48+
section of the |service| Admin API specification.
49+
b. Under :guilabel:`Request samples` on the right side, click
50+
:guilabel:`Expand all`.
51+
c. Click :guilabel:`Copy` to copy the sample request.
11252

113-
After you create the file, run the command to create the |fts|
114-
search index and specify the ``deploymentName`` and the ``file``.
115-
The following example creates a search index for a deployment
116-
named ``myLocalRs`` using a JSON index configuration file named
117-
``search-config.json``:
53+
.. step:: Create the configuration file.
54+
55+
a. Paste the copied sample request into a text editor and change
56+
the values to reflect your values.
57+
b. Save the file with a ``.json`` extension.
11858

119-
.. code-block::
59+
.. step:: Run the |atlas-cli command| command with
60+
the ``--file`` option.
12061

121-
atlas deployments search indexes create --deploymentName myLocalRs --file search-config.json --output json
62+
Specify the path to the file you saved with the ``--file`` flag.

0 commit comments

Comments
 (0)