:doc:`ConnectWisdomService <../../wisdom>` / Client / query_assistant

***************
query_assistant
***************



.. py:method:: ConnectWisdomService.Client.query_assistant(**kwargs)

  

  Performs a manual search against the specified assistant. To retrieve recommendations for an assistant, use `GetRecommendations <https://docs.aws.amazon.com/wisdom/latest/APIReference/API_GetRecommendations.html>`__.

  

  .. danger::

        This operation is deprecated and may not function as expected. This operation should not be used going forward and is only kept for the purpose of backwards compatiblity.


  

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


  **Request Syntax**
  ::

    response = client.query_assistant(
        assistantId='string',
        maxResults=123,
        nextToken='string',
        queryText='string'
    )
    
  :type assistantId: string
  :param assistantId: **[REQUIRED]** 

    The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.

    

  
  :type maxResults: integer
  :param maxResults: 

    The maximum number of results to return per page.

    

  
  :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 queryText: string
  :param queryText: **[REQUIRED]** 

    The text to search for.

    

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

    
    ::

      {
          'nextToken': 'string',
          'results': [
              {
                  'document': {
                      'contentReference': {
                          'contentArn': 'string',
                          'contentId': 'string',
                          'knowledgeBaseArn': 'string',
                          'knowledgeBaseId': 'string'
                      },
                      'excerpt': {
                          'highlights': [
                              {
                                  'beginOffsetInclusive': 123,
                                  'endOffsetExclusive': 123
                              },
                          ],
                          'text': 'string'
                      },
                      'title': {
                          'highlights': [
                              {
                                  'beginOffsetInclusive': 123,
                                  'endOffsetExclusive': 123
                              },
                          ],
                          'text': 'string'
                      }
                  },
                  'relevanceScore': 123.0,
                  'resultId': 'string'
              },
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

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

        If there are additional results, this is the token for the next set of results.

        
      

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

        The results of the query.

        
        

        - *(dict) --* 

          Information about the result.

          
          

          - **document** *(dict) --* 

            The document.

            
            

            - **contentReference** *(dict) --* 

              A reference to the content resource.

              
              

              - **contentArn** *(string) --* 

                The Amazon Resource Name (ARN) of the content.

                
              

              - **contentId** *(string) --* 

                The identifier of the content.

                
              

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

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

                
              

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

                The identifier of the knowledge base. This should not be a QUICK_RESPONSES type knowledge base if you're storing Wisdom Content resource to it.

                
          
            

            - **excerpt** *(dict) --* 

              The excerpt from the document.

              
              

              - **highlights** *(list) --* 

                Highlights in the document text.

                
                

                - *(dict) --* 

                  Offset specification to describe highlighting of document excerpts for rendering search results and recommendations.

                  
                  

                  - **beginOffsetInclusive** *(integer) --* 

                    The offset for the start of the highlight.

                    
                  

                  - **endOffsetExclusive** *(integer) --* 

                    The offset for the end of the highlight.

                    
              
            
              

              - **text** *(string) --* 

                Text in the document.

                
          
            

            - **title** *(dict) --* 

              The title of the document.

              
              

              - **highlights** *(list) --* 

                Highlights in the document text.

                
                

                - *(dict) --* 

                  Offset specification to describe highlighting of document excerpts for rendering search results and recommendations.

                  
                  

                  - **beginOffsetInclusive** *(integer) --* 

                    The offset for the start of the highlight.

                    
                  

                  - **endOffsetExclusive** *(integer) --* 

                    The offset for the end of the highlight.

                    
              
            
              

              - **text** *(string) --* 

                Text in the document.

                
          
        
          

          - **relevanceScore** *(float) --* 

            The relevance score of the results.

            
          

          - **resultId** *(string) --* 

            The identifier of the result data.

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

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

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

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

  