SearchResponse

Response message for SearchService.Search method.

JSON representation
{
  "results": [
    {
      object (SearchResult)
    }
  ],
  "facets": [
    {
      object (Facet)
    }
  ],
  "totalSize": integer,
  "attributionToken": string,
  "redirectUri": string,
  "nextPageToken": string,
  "correctedQuery": string,
  "summary": {
    object (Summary)
  },
  "queryExpansionInfo": {
    object (QueryExpansionInfo)
  },
  "sessionInfo": {
    object (SessionInfo)
  }
}
Fields
results[]

object (SearchResult)

A list of matched documents. The order represents the ranking.

facets[]

object (Facet)

Results of facets requested by user.

totalSize

integer

The estimated total count of matched items irrespective of pagination. The count of results returned by pagination may be less than the totalSize that matches.

attributionToken

string

A unique search token. This should be included in the UserEvent logs resulting from this search, which enables accurate attribution of search model performance. This also helps to identify a request during the customer support scenarios.

redirectUri

string

The URI of a customer-defined redirect page. If redirect action is triggered, no search is performed, and only redirectUri and attributionToken are set in the response.

nextPageToken

string

A token that can be sent as SearchRequest.page_token to retrieve the next page. If this field is omitted, there are no subsequent pages.

correctedQuery

string

Contains the spell corrected query, if found. If the spell correction type is AUTOMATIC, then the search results are based on correctedQuery. Otherwise the original query is used for search.

summary

object (Summary)

A summary as part of the search results. This field is only returned if SearchRequest.ContentSearchSpec.summary_spec is set.

queryExpansionInfo

object (QueryExpansionInfo)

Query expansion information for the returned results.

sessionInfo

object (SessionInfo)

Session information.

Only set if SearchRequest.session is provided. See its description for more details.

Facet

A facet result.

JSON representation
{
  "key": string,
  "values": [
    {
      object (FacetValue)
    }
  ],
  "dynamicFacet": boolean
}
Fields
key

string

The key for this facet. For example, "colors" or "price". It matches SearchRequest.FacetSpec.FacetKey.key.

values[]

object (FacetValue)

The facet values for this field.

dynamicFacet

boolean

Whether the facet is dynamically generated.

FacetValue

A facet value which contains value names and their count.

JSON representation
{
  "count": string,

  // Union field facet_value can be only one of the following:
  "value": string,
  "interval": {
    object (Interval)
  }
  // End of list of possible types for union field facet_value.
}
Fields
count

string (int64 format)

Number of items that have this facet value.

Union field facet_value. A facet value which contains values. facet_value can be only one of the following:
value

string

Text value of a facet, such as "Black" for facet "colors".

interval

object (Interval)

Interval value for a facet, such as [10, 20) for facet "price". It matches SearchRequest.FacetSpec.FacetKey.intervals.

QueryExpansionInfo

Information describing query expansion including whether expansion has occurred.

JSON representation
{
  "expandedQuery": boolean,
  "pinnedResultCount": string
}
Fields
expandedQuery

boolean

Bool describing whether query expansion has occurred.

pinnedResultCount

string (int64 format)

Number of pinned results. This field will only be set when expansion happens and SearchRequest.QueryExpansionSpec.pin_unexpanded_results is set to true.

SessionInfo

Information about the session.

JSON representation
{
  "name": string,
  "queryId": string
}
Fields
name

string

Name of the session. If the auto-session mode is used (when SearchRequest.session ends with "-"), this field holds the newly generated session name.

queryId

string

Query ID that corresponds to this search API call. One session can have multiple turns, each with a unique query ID.

By specifying the session name and this query ID in the Answer API call, the answer generation happens in the context of the search results from this search call.