:doc:`OpenSearchServiceServerless <../../opensearchserverless>` / Client / update_index

************
update_index
************



.. py:method:: OpenSearchServiceServerless.Client.update_index(**kwargs)

  

  Updates an existing index in an OpenSearch Serverless collection. This operation allows you to modify the index schema, including adding new fields or changing field mappings. You can also enable automatic semantic enrichment ingestion and search. For more information, see `About automatic semantic enrichment <https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-manage.html#serverless-semantic-enrichment>`__.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/UpdateIndex>`_  


  **Request Syntax**
  ::

    response = client.update_index(
        id='string',
        indexName='string',
        indexSchema={...}|[...]|123|123.4|'string'|True|None
    )
    
  :type id: string
  :param id: **[REQUIRED]** 

    The unique identifier of the collection containing the index to update.

    

  
  :type indexName: string
  :param indexName: **[REQUIRED]** 

    The name of the index to update.

    

  
  :type indexSchema: :ref:`document<document>`
  :param indexSchema: 

    The updated JSON schema definition for the index, including field mappings and settings.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {}
      
    **Response Structure**

    

    - *(dict) --* 
  
  **Exceptions**
  
  *   :py:class:`OpenSearchServiceServerless.Client.exceptions.InternalServerException`

  
  *   :py:class:`OpenSearchServiceServerless.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`OpenSearchServiceServerless.Client.exceptions.ValidationException`

  