:doc:`QConnect <../../qconnect>` / Client / search_quick_responses

**********************
search_quick_responses
**********************



.. py:method:: QConnect.Client.search_quick_responses(**kwargs)

  

  Searches existing Amazon Q in Connect quick responses in an Amazon Q in Connect knowledge base.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/SearchQuickResponses>`_  


  **Request Syntax**
  ::

    response = client.search_quick_responses(
        knowledgeBaseId='string',
        searchExpression={
            'queries': [
                {
                    'name': 'string',
                    'values': [
                        'string',
                    ],
                    'operator': 'CONTAINS'|'CONTAINS_AND_PREFIX',
                    'allowFuzziness': True|False,
                    'priority': 'HIGH'|'MEDIUM'|'LOW'
                },
            ],
            'filters': [
                {
                    'name': 'string',
                    'values': [
                        'string',
                    ],
                    'operator': 'EQUALS'|'PREFIX',
                    'includeNoExistence': True|False
                },
            ],
            'orderOnField': {
                'name': 'string',
                'order': 'ASC'|'DESC'
            }
        },
        nextToken='string',
        maxResults=123,
        attributes={
            'string': 'string'
        }
    )
    
  :type knowledgeBaseId: string
  :param knowledgeBaseId: **[REQUIRED]** 

    The identifier of the knowledge base. This should be a QUICK_RESPONSES type knowledge base. Can be either the ID or the ARN. URLs cannot contain the ARN.

    

  
  :type searchExpression: dict
  :param searchExpression: **[REQUIRED]** 

    The search expression for querying the quick response.

    

  
    - **queries** *(list) --* 

      The quick response query expressions.

      

    
      - *(dict) --* 

        The quick response fields to query quick responses by.

         

        The following is the list of supported field names.

         

        
        * content
         
        * name
         
        * description
         
        * shortcutKey
        

        

      
        - **name** *(string) --* **[REQUIRED]** 

          The name of the attribute to query the quick responses by.

          

        
        - **values** *(list) --* **[REQUIRED]** 

          The values of the attribute to query the quick responses by.

          

        
          - *(string) --* 

          
      
        - **operator** *(string) --* **[REQUIRED]** 

          The operator to use for matching attribute field values in the query.

          

        
        - **allowFuzziness** *(boolean) --* 

          Whether the query expects only exact matches on the attribute field values. The results of the query will only include exact matches if this parameter is set to false.

          

        
        - **priority** *(string) --* 

          The importance of the attribute field when calculating query result relevancy scores. The value set for this parameter affects the ordering of search results.

          

        
      
  
    - **filters** *(list) --* 

      The configuration of filtering rules applied to quick response query results.

      

    
      - *(dict) --* 

        The quick response fields to filter the quick response query results by.

         

        The following is the list of supported field names.

         

        
        * name
         
        * description
         
        * shortcutKey
         
        * isActive
         
        * channels
         
        * language
         
        * contentType
         
        * createdTime
         
        * lastModifiedTime
         
        * lastModifiedBy
         
        * groupingConfiguration.criteria
         
        * groupingConfiguration.values
        

        

      
        - **name** *(string) --* **[REQUIRED]** 

          The name of the attribute field to filter the quick responses by.

          

        
        - **values** *(list) --* 

          The values of attribute field to filter the quick response by.

          

        
          - *(string) --* 

          
      
        - **operator** *(string) --* **[REQUIRED]** 

          The operator to use for filtering.

          

        
        - **includeNoExistence** *(boolean) --* 

          Whether to treat null value as a match for the attribute field.

          

        
      
  
    - **orderOnField** *(dict) --* 

      The quick response attribute fields on which the query results are ordered.

      

    
      - **name** *(string) --* **[REQUIRED]** 

        The name of the attribute to order the quick response query results by.

        

      
      - **order** *(string) --* 

        The order at which the quick responses are sorted by.

        

      
    
  
  :type nextToken: string
  :param nextToken: 

    The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.

    

  
  :type maxResults: integer
  :param maxResults: 

    The maximum number of results to return per page.

    

  
  :type attributes: dict
  :param attributes: 

    The `user-defined Amazon Connect contact attributes <https://docs.aws.amazon.com/connect/latest/adminguide/connect-attrib-list.html#user-defined-attributes>`__ to be resolved when search results are returned.

    

  
    - *(string) --* 

    
      - *(string) --* 

      


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

    
    ::

      {
          'results': [
              {
                  'quickResponseArn': 'string',
                  'quickResponseId': 'string',
                  'knowledgeBaseArn': 'string',
                  'knowledgeBaseId': 'string',
                  'name': 'string',
                  'contentType': 'string',
                  'status': 'CREATE_IN_PROGRESS'|'CREATE_FAILED'|'CREATED'|'DELETE_IN_PROGRESS'|'DELETE_FAILED'|'DELETED'|'UPDATE_IN_PROGRESS'|'UPDATE_FAILED',
                  'contents': {
                      'plainText': {
                          'content': 'string'
                      },
                      'markdown': {
                          'content': 'string'
                      }
                  },
                  'createdTime': datetime(2015, 1, 1),
                  'lastModifiedTime': datetime(2015, 1, 1),
                  'isActive': True|False,
                  'description': 'string',
                  'groupingConfiguration': {
                      'criteria': 'string',
                      'values': [
                          'string',
                      ]
                  },
                  'shortcutKey': 'string',
                  'lastModifiedBy': 'string',
                  'channels': [
                      'string',
                  ],
                  'language': 'string',
                  'attributesNotInterpolated': [
                      'string',
                  ],
                  'attributesInterpolated': [
                      'string',
                  ],
                  'tags': {
                      'string': 'string'
                  }
              },
          ],
          'nextToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **results** *(list) --* 

        The results of the quick response search.

        
        

        - *(dict) --* 

          The result of quick response search.

          
          

          - **quickResponseArn** *(string) --* 

            The Amazon Resource Name (ARN) of the quick response.

            
          

          - **quickResponseId** *(string) --* 

            The identifier of the quick response.

            
          

          - **knowledgeBaseArn** *(string) --* 

            The Amazon Resource Name (ARN) of the knowledge base.

            
          

          - **knowledgeBaseId** *(string) --* 

            The identifier of the knowledge base. Can be either the ID or the ARN. URLs cannot contain the ARN.

            
          

          - **name** *(string) --* 

            The name of the quick response.

            
          

          - **contentType** *(string) --* 

            The media type of the quick response content.

             

            
            * Use ``application/x.quickresponse;format=plain`` for quick response written in plain text.
             
            * Use ``application/x.quickresponse;format=markdown`` for quick response written in richtext.
            

            
          

          - **status** *(string) --* 

            The resource status of the quick response.

            
          

          - **contents** *(dict) --* 

            The contents of the quick response.

            
            

            - **plainText** *(dict) --* 

              The container quick response content.

              .. note::    This is a Tagged Union structure. Only one of the     following top level keys will be set: ``content``.     If a client receives an unknown member it will     set ``SDK_UNKNOWN_MEMBER`` as the top level key,     which maps to the name or tag of the unknown     member. The structure of ``SDK_UNKNOWN_MEMBER`` is     as follows::

                            'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}


            
              

              - **content** *(string) --* 

                The content of the quick response.

                
          
            

            - **markdown** *(dict) --* 

              The container quick response content.

              .. note::    This is a Tagged Union structure. Only one of the     following top level keys will be set: ``content``.     If a client receives an unknown member it will     set ``SDK_UNKNOWN_MEMBER`` as the top level key,     which maps to the name or tag of the unknown     member. The structure of ``SDK_UNKNOWN_MEMBER`` is     as follows::

                            'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}


            
              

              - **content** *(string) --* 

                The content of the quick response.

                
          
        
          

          - **createdTime** *(datetime) --* 

            The timestamp when the quick response was created.

            
          

          - **lastModifiedTime** *(datetime) --* 

            The timestamp when the quick response search result data was last modified.

            
          

          - **isActive** *(boolean) --* 

            Whether the quick response is active.

            
          

          - **description** *(string) --* 

            The description of the quick response.

            
          

          - **groupingConfiguration** *(dict) --* 

            The configuration information of the user groups that the quick response is accessible to.

            
            

            - **criteria** *(string) --* 

              The criteria used for grouping Amazon Q in Connect users.

               

              The following is the list of supported criteria values.

               

              
              * ``RoutingProfileArn``: Grouping the users by their `Amazon Connect routing profile ARN <https://docs.aws.amazon.com/connect/latest/APIReference/API_RoutingProfile.html>`__. User should have `SearchRoutingProfile <https://docs.aws.amazon.com/connect/latest/APIReference/API_SearchRoutingProfiles.html>`__ and `DescribeRoutingProfile <https://docs.aws.amazon.com/connect/latest/APIReference/API_DescribeRoutingProfile.html>`__ permissions when setting criteria to this value.
              

              
            

            - **values** *(list) --* 

              The list of values that define different groups of Amazon Q in Connect users.

               

              
              * When setting ``criteria`` to ``RoutingProfileArn``, you need to provide a list of ARNs of `Amazon Connect routing profiles <https://docs.aws.amazon.com/connect/latest/APIReference/API_RoutingProfile.html>`__ as values of this parameter.
              

              
              

              - *(string) --* 
          
        
          

          - **shortcutKey** *(string) --* 

            The shortcut key of the quick response. The value should be unique across the knowledge base.

            
          

          - **lastModifiedBy** *(string) --* 

            The Amazon Resource Name (ARN) of the user who last updated the quick response search result data.

            
          

          - **channels** *(list) --* 

            The Amazon Connect contact channels this quick response applies to. The supported contact channel types include ``Chat``.

            
            

            - *(string) --* 
        
          

          - **language** *(string) --* 

            The language code value for the language in which the quick response is written.

            
          

          - **attributesNotInterpolated** *(list) --* 

            The user defined contact attributes that are not resolved when the search result is returned.

            
            

            - *(string) --* 
        
          

          - **attributesInterpolated** *(list) --* 

            The user defined contact attributes that are resolved when the search result is returned.

            
            

            - *(string) --* 
        
          

          - **tags** *(dict) --* 

            The tags used to organize, track, or control access for this resource.

            
            

            - *(string) --* 
              

              - *(string) --* 
        
      
      
    
      

      - **nextToken** *(string) --* 

        The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.

        
  
  **Exceptions**
  
  *   :py:class:`QConnect.Client.exceptions.RequestTimeoutException`

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

  
  *   :py:class:`QConnect.Client.exceptions.UnauthorizedException`

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

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

  