:doc:`CloudTrail <../../cloudtrail>` / Client / search_sample_queries

*********************
search_sample_queries
*********************



.. py:method:: CloudTrail.Client.search_sample_queries(**kwargs)

  

  Searches sample queries and returns a list of sample queries that are sorted by relevance. To search for sample queries, provide a natural language ``SearchPhrase`` in English.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/SearchSampleQueries>`_  


  **Request Syntax**
  ::

    response = client.search_sample_queries(
        SearchPhrase='string',
        MaxResults=123,
        NextToken='string'
    )
    
  :type SearchPhrase: string
  :param SearchPhrase: **[REQUIRED]** 

    The natural language phrase to use for the semantic search. The phrase must be in English. The length constraint is in characters, not words.

    

  
  :type MaxResults: integer
  :param MaxResults: 

    The maximum number of results to return on a single page. The default value is 10.

    

  
  :type NextToken: string
  :param NextToken: 

    A token you can use to get the next page of results. The length constraint is in characters, not words.

    

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

    
    ::

      {
          'SearchResults': [
              {
                  'Name': 'string',
                  'Description': 'string',
                  'SQL': 'string',
                  'Relevance': ...
              },
          ],
          'NextToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **SearchResults** *(list) --* 

        A list of objects containing the search results ordered from most relevant to least relevant.

        
        

        - *(dict) --* 

          A search result returned by the ``SearchSampleQueries`` operation.

          
          

          - **Name** *(string) --* 

            The name of a sample query.

            
          

          - **Description** *(string) --* 

            A longer description of a sample query.

            
          

          - **SQL** *(string) --* 

            The SQL code of the sample query.

            
          

          - **Relevance** *(float) --* 

            A value between 0 and 1 indicating the similarity between the search phrase and result.

            
      
    
      

      - **NextToken** *(string) --* 

        A token you can use to get the next page of results.

        
  
  **Exceptions**
  
  *   :py:class:`CloudTrail.Client.exceptions.InvalidParameterException`

  
  *   :py:class:`CloudTrail.Client.exceptions.UnsupportedOperationException`

  
  *   :py:class:`CloudTrail.Client.exceptions.OperationNotPermittedException`

  