Skip to content

Commit 30a49fa

Browse files
DOCSP-34512 update steps for Atlas Search Index Configuration File (#231)
* DOCSP-34512 update steps for Atlas Search Index Configuration File * DOCSP-34512 updating the submodule to 1.14.0
1 parent 701aef1 commit 30a49fa

File tree

2 files changed

+63
-14
lines changed

2 files changed

+63
-14
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"collectionName": "listingsAndReviews",
3+
"database": "sample_airbnb",
4+
"name": "myIndex",
5+
"mappings": {
6+
"dynamic": false,
7+
"fields": {
8+
"name": {
9+
"type": "string"
10+
},
11+
"property_type": {
12+
"type": "string"
13+
}
14+
}
15+
}
16+
}

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

Lines changed: 47 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@ Atlas Search Index Configuration File
1111
:class: singlecol
1212

1313
You can use an |fts| index configuration file to specify the required
14-
settings for :ref:`creating a search index
15-
<atlas-clusters-search-indexes-create>` using the {+atlas-cli+}. The
16-
{+atlas-cli+} accepts ``.json`` search index configuration files.
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.
1720

1821
.. _search-index-settings:
1922

@@ -59,30 +62,60 @@ the request body schema in the API specification:
5962
:atlas:`Atlas Search Index Syntax
6063
</atlas-search/index-definitions/>`.
6164

62-
6365
.. _example-search-index-config-file:
6466

6567
Example Atlas Search Index Configuration File
6668
---------------------------------------------
6769

68-
To create an |fts| index, specify the search index details as shown in
69-
the following example file:
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
7082

71-
.. literalinclude:: /includes/create-atlas-search-index-config-file.json
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
7291

7392
Example Atlas Search Index Create Command
7493
-----------------------------------------
7594

76-
After you create the file, run the command to create the |fts| search
77-
index and specify the ``clusterName`` and the ``file``. The
78-
following example creates a search index for the cluster named
79-
myCluster using a JSON index configuration file named
80-
search-config.json:
95+
.. tabs::
96+
97+
.. tab:: Cloud Deployment
98+
:tabid: cloud
99+
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``:
81105

82-
.. code-block::
106+
.. code-block::
83107

84-
atlas clusters search indexes create --clusterName myCluster --file /search-config.json --output json
108+
atlas clusters search indexes create --clusterName myCluster --file /search-config.json --output json
85109

110+
.. tab:: Local Deployment
111+
:tabid: local
86112

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``:
87118

119+
.. code-block::
88120

121+
atlas deployments search indexes create --deploymentName myLocalRs --file /search-config.json --output json

0 commit comments

Comments
 (0)