Class QueryResponse

java.lang.Object
com.ibm.cloud.sdk.core.service.model.GenericModel
com.ibm.watson.discovery.v1.model.QueryResponse
All Implemented Interfaces:
com.ibm.cloud.sdk.core.service.model.ObjectModel

public class QueryResponse
extends com.ibm.cloud.sdk.core.service.model.GenericModel
A response containing the documents and aggregations for the query.
  • Constructor Details

    • QueryResponse

      public QueryResponse()
  • Method Details

    • getMatchingResults

      public Long getMatchingResults()
      Gets the matchingResults.

      The number of matching results for the query.

      Returns:
      the matchingResults
    • getResults

      public List<QueryResult> getResults()
      Gets the results.

      Array of document results for the query.

      Returns:
      the results
    • getAggregations

      public List<QueryAggregation> getAggregations()
      Gets the aggregations.

      Array of aggregation results for the query.

      Returns:
      the aggregations
    • getPassages

      public List<QueryPassages> getPassages()
      Gets the passages.

      Array of passage results for the query.

      Returns:
      the passages
    • getDuplicatesRemoved

      public Long getDuplicatesRemoved()
      Gets the duplicatesRemoved.

      The number of duplicate results removed.

      Returns:
      the duplicatesRemoved
    • getSessionToken

      public String getSessionToken()
      Gets the sessionToken.

      The session token for this query. The session token can be used to add events associated with this query to the query and event log.

      **Important:** Session tokens are case sensitive.

      Returns:
      the sessionToken
    • getRetrievalDetails

      public RetrievalDetails getRetrievalDetails()
      Gets the retrievalDetails.

      An object contain retrieval type information.

      Returns:
      the retrievalDetails
    • getSuggestedQuery

      public String getSuggestedQuery()
      Gets the suggestedQuery.

      The suggestions for a misspelled natural language query.

      Returns:
      the suggestedQuery