Edit an Atlas Search Index¶
You can also manage Atlas Search indexes with the Atlas API.
You can change the index definition of an existing Atlas Search index. You cannot rename an index; if you need to change an index's name, you must create a new index and delete the old one.
Permissions required¶
You must have the:
Project Data Access Read Only
or higher role to view Atlas Search analyzers and indexes using the Atlas UI or API.Project Data Access Admin
or higher role to create and manage Atlas Search analyzers and indexes using the Atlas UI or API.
Procedure¶
Navigate to the Atlas Cluster Overview page.¶
Click Databases in the top-left corner of Atlas to navigate to the Database Deployments page for your project.
Click the cluster name to view cluster details.¶
Click the Search tab.¶
Click and choose one of the following from the dropdown.¶
Edit with Visual Editor for a guided experience.
NoteThe Visual Editor doesn't support custom analyzers or synonym mapping definitions.
- Edit with JSON Editor to edit the raw index definition.
Review current configuration settings and edit them as needed.¶
If you are using the Visual Editor, configure the following settings:
Field NameDescriptionNecessityIndex AnalyzerOptionalSearch AnalyzerOptionalDynamic MappingSpecify dynamic or static mapping of fields. To disable dynamic mapping, set
"dynamic":
toOff
. By default, dynamic mapping is enabled. If you disable dynamic mapping, you must specify the fields to index. To learn more about dynamic and static mappings, see Define Atlas Search Indexes.Corresponds to the
mappings.dynamic
setting.RequiredField MappingsRequired if dynamic mapping is disabled.
To add the fields to index, you must specify the following settings for each field:
- Field name - Name of the field to index.
- Enable Dynamic Mapping - Static or dynamic mapping to use. If you disable dynamic mapping, the data in the field isn't automatically indexed.
- Data Type Configuration - Field data type. To learn more about the supported data types and their options, see BSON Data Types and Atlas Search Field Types.
NoteUnlike compound indexes, the order of fields in the Atlas Search index definition is not important. Fields can be defined in any order.
Corresponds to the
mappings.fields
setting.ConditionalIf you are using the JSON Editor, configure the following settings:
Field NameDescriptionNecessityanalyzer
OptionalsearchAnalyzer
Optionalmappings.dynamic
Specify dynamic or static mapping of fields. To disable dynamic mapping, set
"dynamic":
tofalse
. By default, dynamic mapping is enabled. If you disable dynamic mapping, you must specify the fields to index. To learn more about dynamic and static mappings, see Define Atlas Search Indexes.Requiredmappings.fields
Required if dynamic mapping is disabled.
To add the fields to index, you must specify the following settings for each field:
- Field name - Name of the field to index.
- Enable Dynamic Mapping - Static or dynamic mapping to use. If you disable dynamic mapping, the data in the field isn't automatically indexed.
- Data Type Configuration - Field data type. To learn more about the supported data types and their options, see BSON Data Types and Atlas Search Field Types.
NoteUnlike compound indexes, the order of fields in the Atlas Search index definition is not important. Fields can be defined in any order.
Conditional
Click Save to apply the changes.¶
The index's status changes from Active to Building. In this state, you can continue to use the old index because Atlas Search does not delete the old index until the updated index is ready for use. Once the status returns to Active, the modified index is ready to use.