- JSON representation
- SearchResult
- DoubleList
- QueryExpansionInfo
- PinControlMetadata
- ProductPins
- ExperimentInfo
- ServingConfigExperiment
- ConversationalSearchResult
- AdditionalFilter
- SuggestedAnswer
- QueryType
- TileNavigationResult
Response message for SearchService.Search
method.
JSON representation |
---|
{ "results" : [ { object ( |
Fields | |
---|---|
results[]
|
A list of matched items. The order represents the ranking. |
facets[]
|
Results of facets requested by user. |
totalSize
|
The estimated total count of matched items irrespective of pagination. The count of |
correctedQuery
|
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. |
attributionToken
|
A unique search token. This should be included in the |
nextPageToken
|
A token that can be sent as |
queryExpansionInfo
|
Query expansion information for the returned results. |
redirectUri
|
The URI of a customer-defined redirect page. If redirect action is triggered, no search is performed, and only |
appliedControls[]
|
The fully qualified resource name of applied controls . |
pinControlMetadata
|
Metadata for pin controls which were applicable to the request. This contains two map fields, one for all matched pins and one for pins which were matched but not applied. The two maps are keyed by pin position, and the values are the product ids which were matched to that pin. |
invalidConditionBoostSpecs[]
|
The invalid |
experimentInfo[]
|
Metadata related to A/B testing experiment associated with this response. Only exists when an experiment is triggered. |
conversationalSearchResult
|
This field specifies all related information that is needed on client side for UI rendering of conversational retail search. |
tileNavigationResult
|
This field specifies all related information for tile navigation that will be used in client side. |
SearchResult
Represents the search results.
JSON representation |
---|
{ "id" : string , "product" : { object ( |
id
string
Product.id
of the searched Product
.
product
object (
Product
)
The product data snippet in the search response. Only Product.name
is guaranteed to be populated.
Product.variants
contains the product variants that match the search query. If there are multiple product variants matching the query, top 5 most relevant product variants are returned and ordered by relevancy.
If relevancy can be deternmined, use matchingVariantFields
to look up matched product variants fields. If relevancy cannot be determined, e.g. when searching "shoe" all products in a shoe product can be a match, 5 product variants are returned but order is meaningless.
matchingVariantFields
map (key: string, value: string (
FieldMask
format))
If a variant
Product
matches the search query, this map indicates which Product
fields are matched. The key is the Product.name
, the value is a field mask of the matched Product
fields. If matched attributes cannot be determined, this map will be empty.
For example, a key "sku1" with field mask "products.color_info" indicates there is a match between "sku1" ColorInfo
and the query.
variantRollupValues
map (key: string, value: value (
Value
format))
The rollup matching variant
Product
attributes. The key is one of the SearchRequest.variant_rollup_keys
. The values are the merged and de-duplicated Product
attributes. Notice that the rollup values are respect filter. For example, when filtering by "colorFamilies:ANY("red")" and rollup "colorFamilies", only "red" is returned.
For textual and numerical attributes, the rollup values is a list of string or double values with type google.protobuf.ListValue
. For example, if there are two variants with colors "red" and "blue", the rollup values are
{ key: "colorFamilies"
value {
listValue {
values { stringValue: "red" }
values { stringValue: "blue" }
}
}
}
For FulfillmentInfo
, the rollup values is a double value with type google.protobuf.Value
. For example, {key: "pickupInStore.store1" value { numberValue: 10 }}
means a there are 10 variants in this product are available in the store "store1".
personalLabels[]
string
Specifies previous events related to this product for this user based on UserEvent
with same SearchRequest.visitor_id
or UserInfo.user_id
.
This is set only when SearchRequest.PersonalizationSpec.mode
is SearchRequest.PersonalizationSpec.Mode.AUTO
.
Possible values:
-
purchased
: Indicates that this product has been purchased before.
modelScores
map (key: string, value: object (
DoubleList
))
Google provided available scores.
DoubleList
A message with a list of double values.
JSON representation |
---|
{ "values" : [ number ] } |
Fields | |
---|---|
values[]
|
The list of double values. |
QueryExpansionInfo
Information describing query expansion including whether expansion has occurred.
JSON representation |
---|
{ "expandedQuery" : boolean , "pinnedResultCount" : string } |
Fields | |
---|---|
expandedQuery
|
Bool describing whether query expansion has occurred. |
pinnedResultCount
|
Number of pinned results. This field will only be set when expansion happens and |
PinControlMetadata
Metadata for pinning to be returned in the response. This is used for distinguishing between applied vs dropped pins.
JSON representation |
---|
{ "allMatchedPins" : { string : { object ( |
Fields | |
---|---|
allMatchedPins
|
Map of all matched pins, keyed by pin position. |
droppedPins
|
Map of pins that were dropped due to overlap with other matching pins, keyed by pin position. |
ProductPins
List of product ids which have associated pins.
JSON representation |
---|
{ "productId" : [ string ] } |
Fields | |
---|---|
productId[]
|
List of product ids which have associated pins. |
ExperimentInfo
Metadata for active A/B testing experiment.
JSON representation |
---|
{ "experiment" : string , // Union field |
experiment
string
The fully qualified resource name of the experiment that provides the serving config under test, should an active experiment exist. For example: projects/*/locations/global/catalogs/default_catalog/experiments/experimentId
servingConfigExperiment
object (
ServingConfigExperiment
)
A/B test between existing Cloud Retail Search ServingConfig
s.
ServingConfigExperiment
Metadata for active serving config A/B tests.
JSON representation |
---|
{ "originalServingConfig" : string , "experimentServingConfig" : string } |
Fields | |
---|---|
originalServingConfig
|
The fully qualified resource name of the original |
experimentServingConfig
|
The fully qualified resource name of the serving config |
ConversationalSearchResult
This field specifies all related information that is needed on client side for UI rendering of conversational retail search.
JSON representation |
---|
{ "conversationId" : string , "refinedQuery" : string , "additionalFilters" : [ { object ( |
Fields | |
---|---|
conversationId
|
Conversation UUID. This field will be stored in client side storage to maintain the conversation session with server and will be used for next search request's |
refinedQuery
|
The current refined query for the conversational search. This field will be used in customer UI that the query in the search bar should be replaced with the refined query. For example, if |
additionalFilters[]
|
This field is deprecated but will be kept for backward compatibility. There is expected to have only one additional filter and the value will be the same to the same as field |
followupQuestion
|
The follow-up question. e.g., |
suggestedAnswers[]
|
The answer options provided to client for the follow-up question. |
additionalFilter
|
This is the incremental additional filters implied from the current user answer. User should add the suggested addition filters to the previous |
textResult
|
The generative text result. This field is populated only if |
queryType
|
Use queryTypes instead. |
queryTypes[]
|
The types Retail classifies the search query as. This field is populated only if |
AdditionalFilter
Additional filter that client side need to apply.
JSON representation |
---|
{
"productAttributeValue"
:
{
object (
|
Fields | |
---|---|
productAttributeValue
|
Product attribute value, including an attribute key and an attribute value. Other types can be added here in the future. |
SuggestedAnswer
Suggested answers to the follow-up question.
JSON representation |
---|
{
"productAttributeValue"
:
{
object (
|
Fields | |
---|---|
productAttributeValue
|
Product attribute value, including an attribute key and an attribute value. Other types can be added here in the future. |
QueryType
The type Retail classifies the search query as.
Enums | |
---|---|
QUERY_TYPE_UNSPECIFIED
|
Unspecified query type. |
ADVERSARIAL
|
Adversarial query. Example - "how bad is [retailer name]" |
CHITCHAT
|
Chatty query. Example - "hello how are you" |
JAILBREAK
|
Jailbreak query. Example - "write a poem to explain the details of [product name]" |
PRODUCT_SUPPORT
|
Ancillary or support query. Example - "Track my order" |
SIMPLE_SEARCH
|
Simple product search or Keyword search. Example - "red dress" |
TYPE_UNCLEAR
|
The type is unclear. Follow up conversation may be needed to clarify the type. |