@@ -11,9 +11,12 @@ Atlas Search Index Configuration File
11
11
:class: singlecol
12
12
13
13
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.
17
20
18
21
.. _search-index-settings:
19
22
@@ -59,30 +62,60 @@ the request body schema in the API specification:
59
62
:atlas:`Atlas Search Index Syntax
60
63
</atlas-search/index-definitions/>`.
61
64
62
-
63
65
.. _example-search-index-config-file:
64
66
65
67
Example Atlas Search Index Configuration File
66
68
---------------------------------------------
67
69
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
70
82
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
72
91
73
92
Example Atlas Search Index Create Command
74
93
-----------------------------------------
75
94
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``:
81
105
82
- .. code-block::
106
+ .. code-block::
83
107
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
85
109
110
+ .. tab:: Local Deployment
111
+ :tabid: local
86
112
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``:
87
118
119
+ .. code-block::
88
120
121
+ atlas deployments search indexes create --deploymentName myLocalRs --file /search-config.json --output json
0 commit comments