Update One Atlas Search Index by Name
Updates one Atlas Search index that you identified with its database, collection name, and index name. Atlas Search indexes define the fields on which to create the index and the analyzers to use when creating the index. To use this resource, the requesting Service Account or API Key must have the Project Data Access Admin role.
Path parameters
-
Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
NOTE: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups.
Format should match the following pattern:
^([a-f0-9]{24})$
. -
Name of the cluster that contains the collection whose Atlas Search index you want to update.
Format should match the following pattern:
^[a-zA-Z0-9][a-zA-Z0-9-]*$
. -
Name of the collection that contains one or more Atlas Search indexes.
-
Label that identifies the database that contains the collection with one or more Atlas Search indexes.
-
Name of the Atlas Search index to update.
Query parameters
-
Flag that indicates whether Application wraps the response in an
envelope
JSON object. Some API clients cannot access the HTTP response headers or status code. To remediate this, set envelope=true in the query. Endpoints that return a list of results use the results object as an envelope. Application adds the status parameter to the response body.Default value is
false
. -
Flag that indicates whether the response body should be in the prettyprint format.
Default value is
false
.Prettyprint
curl \
--request PATCH 'https://cloud.mongodb.com/api/atlas/v2/groups/32b6e34b3d91647abb20e7b8/clusters/{clusterName}/search/indexes/{databaseName}/{collectionName}/{indexName}' \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "Content-Type: application/vnd.atlas.2024-05-30+json"
{
"definition": {
"analyzer": "lucene.standard",
"analyzers": [
{
"charFilters": [
{
"additionalProperty1": {},
"additionalProperty2": {}
}
],
"name": "string",
"tokenFilters": [
{
"additionalProperty1": {},
"additionalProperty2": {}
}
],
"tokenizer": {
"additionalProperty1": {},
"additionalProperty2": {}
}
}
],
"mappings": {
"dynamic": true,
"fields": {
"additionalProperty1": {},
"additionalProperty2": {}
}
},
"numPartitions": 1,
"searchAnalyzer": "lucene.standard",
"storedSource": {
"include | exclude": [
"field1",
"field2"
]
},
"synonyms": [
{
"analyzer": "lucene.standard",
"name": "string",
"source": {
"collection": "string"
}
}
]
}
}
{
"collectionName": "string",
"database": "string",
"indexID": "32b6e34b3d91647abb20e7b8",
"latestDefinition": {
"numPartitions": 1,
"analyzer": "lucene.standard",
"analyzers": [
{
"charFilters": [
{
"additionalProperty1": {},
"additionalProperty2": {}
}
],
"name": "string",
"tokenFilters": [
{
"additionalProperty1": {},
"additionalProperty2": {}
}
],
"tokenizer": {
"additionalProperty1": {},
"additionalProperty2": {}
}
}
],
"mappings": {
"dynamic": true,
"fields": {
"additionalProperty1": {},
"additionalProperty2": {}
}
},
"searchAnalyzer": "lucene.standard",
"storedSource": {
"include | exclude": [
"field1",
"field2"
]
},
"synonyms": [
{
"analyzer": "lucene.standard",
"name": "string",
"source": {
"collection": "string"
}
}
]
},
"latestDefinitionVersion": {
"createdAt": "2025-05-04T09:42:00Z",
"version": 42
},
"name": "string",
"queryable": true,
"status": "DELETING",
"statusDetail": [
{
"hostname": "string",
"mainIndex": {
"definition": {
"numPartitions": 1
},
"definitionVersion": {
"createdAt": "2025-05-04T09:42:00Z",
"version": 42
},
"message": "string",
"queryable": true,
"status": "DELETING"
},
"queryable": true,
"stagedIndex": {
"definition": {
"numPartitions": 1
},
"definitionVersion": {
"createdAt": "2025-05-04T09:42:00Z",
"version": 42
},
"message": "string",
"queryable": true,
"status": "DELETING"
},
"status": "DELETING"
}
],
"type": "search",
"synonymMappingStatus": "FAILED",
"synonymMappingStatusDetail": [
{
"additionalProperty1": {
"message": "string",
"queryable": true,
"status": "FAILED"
},
"additionalProperty2": {
"message": "string",
"queryable": true,
"status": "FAILED"
}
}
]
}
{
"collectionName": "string",
"database": "string",
"indexID": "32b6e34b3d91647abb20e7b8",
"latestDefinition": {
"numPartitions": 1,
"fields": [
{
"additionalProperty1": {},
"additionalProperty2": {}
}
]
},
"latestDefinitionVersion": {
"createdAt": "2025-05-04T09:42:00Z",
"version": 42
},
"name": "string",
"queryable": true,
"status": "DELETING",
"statusDetail": [
{
"hostname": "string",
"mainIndex": {
"definition": {
"numPartitions": 1
},
"definitionVersion": {
"createdAt": "2025-05-04T09:42:00Z",
"version": 42
},
"message": "string",
"queryable": true,
"status": "DELETING"
},
"queryable": true,
"stagedIndex": {
"definition": {
"numPartitions": 1
},
"definitionVersion": {
"createdAt": "2025-05-04T09:42:00Z",
"version": 42
},
"message": "string",
"queryable": true,
"status": "DELETING"
},
"status": "DELETING"
}
],
"type": "vectorSearch"
}
{
"error": 400,
"detail": "(This is just an example, the exception may not be related to this endpoint) No provider AWS exists.",
"reason": "Bad Request",
"errorCode": "VALIDATION_ERROR"
}
{
"error": 401,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Unauthorized",
"errorCode": "NOT_ORG_GROUP_CREATOR"
}
{
"error": 403,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Forbidden",
"errorCode": "CANNOT_CHANGE_GROUP_NAME"
}
{
"error": 404,
"detail": "(This is just an example, the exception may not be related to this endpoint) Cannot find resource AWS",
"reason": "Not Found",
"errorCode": "RESOURCE_NOT_FOUND"
}
{
"error": 409,
"detail": "(This is just an example, the exception may not be related to this endpoint) Cannot delete organization link while there is active migration in following project ids: 60c4fd418ebe251047c50554",
"reason": "Conflict",
"errorCode": "CANNOT_DELETE_ORG_ACTIVE_LIVE_MIGRATION_ATLAS_ORG_LINK"
}
{
"error": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}