Class SearchResult

java.lang.Object
com.ibm.cloud.sdk.core.service.model.GenericModel
com.ibm.watson.assistant.v2.model.SearchResult
All Implemented Interfaces:
com.ibm.cloud.sdk.core.service.model.ObjectModel

public class SearchResult
extends com.ibm.cloud.sdk.core.service.model.GenericModel
SearchResult.
  • Constructor Details

    • SearchResult

      public SearchResult()
  • Method Details

    • getId

      public String getId()
      Gets the id.

      The unique identifier of the document in the Discovery service collection.

      This property is included in responses from search skills, which are available only to Plus or Enterprise plan users.

      Returns:
      the id
    • getResultMetadata

      public SearchResultMetadata getResultMetadata()
      Gets the resultMetadata.

      An object containing search result metadata from the Discovery service.

      Returns:
      the resultMetadata
    • getBody

      public String getBody()
      Gets the body.

      A description of the search result. This is taken from an abstract, summary, or highlight field in the Discovery service response, as specified in the search skill configuration.

      Returns:
      the body
    • getTitle

      public String getTitle()
      Gets the title.

      The title of the search result. This is taken from a title or name field in the Discovery service response, as specified in the search skill configuration.

      Returns:
      the title
    • getUrl

      public String getUrl()
      Gets the url.

      The URL of the original data object in its native data source.

      Returns:
      the url
    • getHighlight

      public SearchResultHighlight getHighlight()
      Gets the highlight.

      An object containing segments of text from search results with query-matching text highlighted using HTML `<em>` tags.

      Returns:
      the highlight
    • getAnswers

      public List<SearchResultAnswer> getAnswers()
      Gets the answers.

      An array specifying segments of text within the result that were identified as direct answers to the search query. Currently, only the single answer with the highest confidence (if any) is returned.

      **Note:** This property uses the answer finding beta feature, and is available only if the search skill is connected to a Discovery v2 service instance.

      Returns:
      the answers