SearchResponse

Response message for SearchService.Search method.

JSON representation
{
  "results": [
    {
      object (SearchResult)
    }
  ],
  "facets": [
    {
      object (Facet)
    }
  ],
  "guidedSearchResult": {
    object (GuidedSearchResult)
  },
  "totalSize": integer,
  "attributionToken": string,
  "redirectUri": string,
  "nextPageToken": string,
  "correctedQuery": string,
  "summary": {
    object (Summary)
  },
  "appliedControls": [
    string
  ],
  "geoSearchDebugInfo": [
    {
      object (GeoSearchDebugInfo)
    }
  ],
  "queryExpansionInfo": {
    object (QueryExpansionInfo)
  },
  "naturalLanguageQueryUnderstandingInfo": {
    object (NaturalLanguageQueryUnderstandingInfo)
  },
  "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.

guidedSearchResult

object (GuidedSearchResult)

Guided search result.

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.

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.

appliedControls[]

string

Controls applied as part of the Control service.

geoSearchDebugInfo[]

object (GeoSearchDebugInfo)

queryExpansionInfo

object (QueryExpansionInfo)

Query expansion information for the returned results.

naturalLanguageQueryUnderstandingInfo

object (NaturalLanguageQueryUnderstandingInfo)

Natural language query understanding 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.

GuidedSearchResult

Guided search result. The guided search helps user to refine the search results and narrow down to the real needs from a broaded search results.

JSON representation
{
  "refinementAttributes": [
    {
      object (RefinementAttribute)
    }
  ],
  "followUpQuestions": [
    string
  ]
}
Fields
refinementAttributes[]

object (RefinementAttribute)

A list of ranked refinement attributes.

followUpQuestions[]

string

Suggested follow-up questions.

RefinementAttribute

Useful attribute for search result refinements.

JSON representation
{
  "attributeKey": string,
  "attributeValue": string
}
Fields
attributeKey

string

Attribute key used to refine the results. For example, "movie_type".

attributeValue

string

Attribute value used to refine the results. For example, "drama".

GeoSearchDebugInfo

Debug information specifically related to forward geocoding issues arising from Geolocation Search.

JSON representation
{
  "originalAddressQuery": string,
  "errorMessage": string
}
Fields
originalAddressQuery

string

The address from which forward geocoding ingestion produced issues.

errorMessage

string

The error produced.

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.

NaturalLanguageQueryUnderstandingInfo

Information describing what natural language understanding was done on the input query.

JSON representation
{
  "extractedFilters": string,
  "rewrittenQuery": string,
  "structuredExtractedFilter": {
    object (StructuredExtractedFilter)
  }
}
Fields
extractedFilters

string

The filters that were extracted from the input query.

rewrittenQuery

string

Rewritten input query minus the extracted filters.

structuredExtractedFilter

object (StructuredExtractedFilter)

The filters that were extracted from the input query represented in a structured form.

StructuredExtractedFilter

The filters that were extracted from the input query represented in a structured form.

JSON representation
{
  "expression": {
    object (Expression)
  }
}
Fields
expression

object (Expression)

The expression denoting the filter that was extracted from the input query in a structured form. It can be a simple expression denoting a single string, numerical or geolocation constraint or a compound expression which is a combination of multiple expressions connected using logical (OR and AND) operators.

Expression

The expression denoting the filter that was extracted from the input query.

JSON representation
{

  // Union field expr can be only one of the following:
  "stringConstraint": {
    object (StringConstraint)
  },
  "numberConstraint": {
    object (NumberConstraint)
  },
  "geolocationConstraint": {
    object (GeolocationConstraint)
  },
  "andExpr": {
    object (AndExpression)
  },
  "orExpr": {
    object (OrExpression)
  }
  // End of list of possible types for union field expr.
}
Fields
Union field expr. The expression type. expr can be only one of the following:
stringConstraint

object (StringConstraint)

String constraint expression.

numberConstraint

object (NumberConstraint)

Numerical constraint expression.

geolocationConstraint

object (GeolocationConstraint)

Geolocation constraint expression.

andExpr

object (AndExpression)

Logical "And" compound operator connecting multiple expressions.

orExpr

object (OrExpression)

Logical "Or" compound operator connecting multiple expressions.

StringConstraint

Constraint expression of a string field.

JSON representation
{
  "fieldName": string,
  "values": [
    string
  ]
}
Fields
fieldName

string

Name of the string field as defined in the schema.

values[]

string

Values of the string field. The record will only be returned if the field value matches one of the values specified here.

NumberConstraint

Constraint expression of a number field. Example: price < 100.

JSON representation
{
  "fieldName": string,
  "comparison": enum (Comparison),
  "value": number
}
Fields
fieldName

string

Name of the numerical field as defined in the schema.

comparison

enum (Comparison)

The comparison operation performed between the field value and the value specified in the constraint.

value

number

The value specified in the numerical constraint.

Comparison

The comparison operation that was performed.

Enums
COMPARISON_UNSPECIFIED Undefined comparison operator.
EQUALS Denotes equality = operator.
LESS_THAN_EQUALS Denotes less than or equal to <= operator.
LESS_THAN Denotes less than < operator.
GREATER_THAN_EQUALS Denotes greater than or equal to >= operator.
GREATER_THAN Denotes greater than > operator.

GeolocationConstraint

Constraint of a geolocation field. Name of the geolocation field as defined in the schema.

JSON representation
{
  "fieldName": string,
  "address": string,
  "radiusInMeters": number
}
Fields
fieldName

string

The name of the geolocation field as defined in the schema.

address

string

The reference address that was inferred from the input query. The proximity of the reference address to the geolocation field will be used to filter the results.

radiusInMeters

number

The radius in meters around the address. The record is returned if the location of the geolocation field is within the radius.

AndExpression

Logical And operator.

JSON representation
{
  "expressions": [
    {
      object (Expression)
    }
  ]
}
Fields
expressions[]

object (Expression)

The expressions that were ANDed together.

OrExpression

Logical Or operator.

JSON representation
{
  "expressions": [
    {
      object (Expression)
    }
  ]
}
Fields
expressions[]

object (Expression)

The expressions that were ORed together.

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.