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

************
create_index
************



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

  

  Creates an index within an OpenSearch Serverless collection. Unlike other OpenSearch indexes, indexes created by this API are automatically configured to conduct 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>`__ in the *OpenSearch User Guide*.

  

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


  **Request Syntax**
  ::

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

    The unique identifier of the collection in which to create the index.

    

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

    The name of the index to create. Index names must be lowercase and can't begin with underscores (_) or hyphens (-).

    

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

    The 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.ConflictException`

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

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

  