SearchResult

public struct SearchResult : Codable, Equatable

SearchResult.

  • 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.

    Declaration

    Swift

    public var id: String
  • An object containing search result metadata from the Discovery service.

    Declaration

    Swift

    public var resultMetadata: SearchResultMetadata
  • 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.

    Declaration

    Swift

    public var body: String?
  • 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.

    Declaration

    Swift

    public var title: String?
  • url

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

    Declaration

    Swift

    public var url: String?
  • An object containing segments of text from search results with query-matching text highlighted using HTML <em> tags.

    Declaration

    Swift

    public var highlight: SearchResultHighlight?
  • 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.

    Declaration

    Swift

    public var answers: [SearchResultAnswer]?