:doc:`OpenSearchService <../../opensearch>` / Client / create_index

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



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

  

  Creates an OpenSearch index with optional automatic semantic enrichment for specified text fields. Automatic semantic enrichment enables semantic search capabilities without requiring machine learning expertise, improving search relevance by up to 20% by understanding search intent and contextual meaning beyond keyword matching. The semantic enrichment process has zero impact on search latency as sparse encodings are stored directly within the index during indexing. For more information, see `Automatic semantic enrichment <https://docs.aws.amazon.com/opensearch-service/latest/developerguide/opensearch-semantic-enrichment.html>`__.

  

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


  **Request Syntax**
  ::

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

    The name of an OpenSearch Service domain. Domain names are unique across the domains owned by an account within an Amazon Web Services Region.

    

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

    The name of the index to create. Must be between 1 and 255 characters and follow OpenSearch naming conventions.

    

  
  :type IndexSchema: :ref:`document<document>`
  :param IndexSchema: **[REQUIRED]** 

    The JSON schema defining index mappings, settings, and semantic enrichment configuration. The schema specifies which text fields should be automatically enriched for semantic search capabilities and includes OpenSearch index configuration parameters.

    

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

    
    ::

      {
          'Status': 'CREATED'|'UPDATED'|'DELETED'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **Status** *(string) --* 

        The status of the index creation operation.

        
  
  **Exceptions**
  
  *   :py:class:`OpenSearchService.Client.exceptions.ValidationException`

  
  *   :py:class:`OpenSearchService.Client.exceptions.AccessDeniedException`

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

  
  *   :py:class:`OpenSearchService.Client.exceptions.ResourceAlreadyExistsException`

  
  *   :py:class:`OpenSearchService.Client.exceptions.InternalException`

  
  *   :py:class:`OpenSearchService.Client.exceptions.DisabledOperationException`

  
  *   :py:class:`OpenSearchService.Client.exceptions.DependencyFailureException`

  
  *   :py:class:`OpenSearchService.Client.exceptions.ThrottlingException`

  