> ## Documentation Index
> Fetch the complete documentation index at: https://docs.open-metadata.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Update a Search Index

> Create or update a search index with a full request body

# Update a Search Index

Create a search index or update it if it already exists, using `PUT /v1/searchIndexes` with the full request body. Send the complete definition, not just the fields you want to change. To change only some fields, use `PATCH` with a JSON Patch array and the `application/json-patch+json` content type, as shown in the PATCH examples below.

## Body Parameters

**name** `string` *required*

Name of the search index. Must be unique within the parent search service.

**service** `string` *required*

Fully qualified name of the parent SearchService, for example `elasticsearch_sample`.

**fields** `array` *required*

Array of field objects defining the index schema.

**properties**

**name** `string`

Name of the field.

**dataType** `string`

Data type of the field, for example `TEXT`, `KEYWORD`, `INTEGER`, `OBJECT`.

**description** `string`

Description of the field.

**children** `array`

Nested child fields for complex types.

**displayName** `string`

Human-readable display name for the search index.

**description** `string`

Description of the search index in Markdown format.

**owners** `array`

Array of owner references (users or teams) to assign to the search index.

**properties**

**id** `string`

UUID of the owner entity.

**type** `string`

Type of owner entity, for example `user`, `team`.

**name** `string`

Name of the owner entity.

**domains** `array`

Fully qualified names of the domains to assign for governance purposes.

**tags** `array`

Array of classification tags to apply to the search index.

**properties**

**tagFQN** `string` *required*

Fully qualified name of the tag.

**labelType** `string`

Type of label, for example `Manual`, `Derived`, `Propagated`.

**state** `string`

State of the tag, for example `Suggested`, `Confirmed`.

**extension** `object`

Custom property values defined by your organization's metadata schema.

```bash PUT /v1/searchIndexes theme={null}
curl -X PUT "{base_url}/api/v1/searchIndexes" \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "table_search_index",
    "displayName": "TableSearchIndex",
    "service": "elasticsearch_sample",
    "description": "Search index for table entities",
    "fields": [
      {"name": "name", "dataType": "TEXT"},
      {"name": "description", "dataType": "TEXT"}
    ]
  }'
```

```python PATCH /v1/searchIndexes/{id} theme={null}
from metadata.sdk import configure
from metadata.sdk.entities import SearchIndexes

configure(
    host="https://your-company.open-metadata.org/api",
    jwt_token="your-jwt-token"
)

# Retrieve, modify, and update
si = SearchIndexes.retrieve("f5b0fa81-f241-4508-9219-dae31dcced18")
si.description = "Updated: Search index for table entities with enhanced mapping"
updated = SearchIndexes.update(si)

print(f"Updated to version {updated.version.root}")
```

```java PATCH /v1/searchIndexes/{id} theme={null}
import org.openmetadata.schema.entity.data.SearchIndex;

// client is an initialized OpenMetadataClient.

// Retrieve, modify, and update
SearchIndex searchIndex = client.searchIndexes().get("f5b0fa81-f241-4508-9219-dae31dcced18");
searchIndex.setDescription("Updated: Search index for table entities with enhanced mapping");
SearchIndex updated = client.searchIndexes().update(searchIndex.getId(), searchIndex);
```

```bash PATCH /v1/searchIndexes/{id} theme={null}
# Update by ID
curl -X PATCH "{base_url}/api/v1/searchIndexes/f5b0fa81-f241-4508-9219-dae31dcced18" \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json-patch+json" \
  -d '[
    {"op": "replace", "path": "/description", "value": "Updated search index for table entities"}
  ]'

# Update by name
curl -X PATCH "{base_url}/api/v1/searchIndexes/name/elasticsearch_sample.table_search_index" \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json-patch+json" \
  -d '[
    {"op": "replace", "path": "/description", "value": "Updated search index for table entities"}
  ]'
```

```json Response theme={null}
{
  "id": "f5b0fa81-f241-4508-9219-dae31dcced18",
  "name": "table_search_index",
  "fullyQualifiedName": "elasticsearch_sample.table_search_index",
  "displayName": "TableSearchIndex",
  "description": "Updated search index for table entities",
  "version": 0.2,
  "updatedAt": 1769982670810,
  "updatedBy": "admin",
  "service": {
    "id": "search-service-id",
    "type": "searchService",
    "name": "elasticsearch_sample",
    "fullyQualifiedName": "elasticsearch_sample",
    "deleted": false
  },
  "serviceType": "ElasticSearch",
  "fields": [
    {"name": "name", "dataType": "TEXT"},
    {"name": "description", "dataType": "TEXT"}
  ],
  "deleted": false,
  "owners": [],
  "tags": [],
  "domains": []
}
```

***

## Returns

Returns the updated search index object with the new version number.

## Response

**id** `string`

Unique identifier for the search index (UUID format).

**name** `string`

Search index name.

**fullyQualifiedName** `string`

Fully qualified name in format `service.indexName`.

**description** `string`

Updated description.

**version** `number`

Incremented version number.

***

## Error Handling

| Code | Error Type | Description |
| - | - | - |
| `400` | `BAD_REQUEST` | Invalid or malformed request body |
| `401` | `UNAUTHORIZED` | Invalid or missing authentication token |
| `403` | `FORBIDDEN` | User lacks permission to update this search index |
| `409` | `CONFLICT` | Concurrent modification detected |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.