|
|
@ -39,8 +39,8 @@ option ruby_package = "Google::Cloud::Retail::V2alpha"; |
|
|
|
// Service for search. |
|
|
|
// Service for search. |
|
|
|
// |
|
|
|
// |
|
|
|
// This feature is only available for users who have Retail Search enabled. |
|
|
|
// This feature is only available for users who have Retail Search enabled. |
|
|
|
// Contact Retail Support (retail-search-support@google.com) if you are |
|
|
|
// Please submit a form [here](https://cloud.google.com/contact) to contact |
|
|
|
// interested in using Retail Search. |
|
|
|
// cloud sales if you are interested in using Retail Search. |
|
|
|
service SearchService { |
|
|
|
service SearchService { |
|
|
|
option (google.api.default_host) = "retail.googleapis.com"; |
|
|
|
option (google.api.default_host) = "retail.googleapis.com"; |
|
|
|
option (google.api.oauth_scopes) = |
|
|
|
option (google.api.oauth_scopes) = |
|
|
@ -49,8 +49,8 @@ service SearchService { |
|
|
|
// Performs a search. |
|
|
|
// Performs a search. |
|
|
|
// |
|
|
|
// |
|
|
|
// This feature is only available for users who have Retail Search enabled. |
|
|
|
// This feature is only available for users who have Retail Search enabled. |
|
|
|
// Contact Retail Support (retail-search-support@google.com) if you are |
|
|
|
// Please submit a form [here](https://cloud.google.com/contact) to contact |
|
|
|
// interested in using Retail Search. |
|
|
|
// cloud sales if you are interested in using Retail Search. |
|
|
|
rpc Search(SearchRequest) returns (SearchResponse) { |
|
|
|
rpc Search(SearchRequest) returns (SearchResponse) { |
|
|
|
option (google.api.http) = { |
|
|
|
option (google.api.http) = { |
|
|
|
post: "/v2alpha/{placement=projects/*/locations/*/catalogs/*/placements/*}:search" |
|
|
|
post: "/v2alpha/{placement=projects/*/locations/*/catalogs/*/placements/*}:search" |
|
|
@ -68,42 +68,42 @@ message SearchRequest { |
|
|
|
// Specifies how a facet is computed. |
|
|
|
// Specifies how a facet is computed. |
|
|
|
message FacetKey { |
|
|
|
message FacetKey { |
|
|
|
// Required. Supported textual and numerical facet keys in |
|
|
|
// Required. Supported textual and numerical facet keys in |
|
|
|
// [Product][google.cloud.retail.v2alpha.Product] object, over which the |
|
|
|
// [Product][google.cloud.retail.v2.Product] object, over which the facet |
|
|
|
// facet values are computed. Facet key is case-sensitive. |
|
|
|
// values are computed. Facet key is case-sensitive. |
|
|
|
// |
|
|
|
// |
|
|
|
// Allowed facet keys when |
|
|
|
// Allowed facet keys when |
|
|
|
// [FacetKey.query][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.query] |
|
|
|
// [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query] |
|
|
|
// is not specified: |
|
|
|
// is not specified: |
|
|
|
// |
|
|
|
// |
|
|
|
// Textual facet keys: |
|
|
|
// * textual_field = |
|
|
|
// * brands |
|
|
|
// * "brands" |
|
|
|
// * categories |
|
|
|
// * "categories" |
|
|
|
// * genders |
|
|
|
// * "genders" |
|
|
|
// * ageGroups |
|
|
|
// * "ageGroups" |
|
|
|
// * availability |
|
|
|
// * "availability" |
|
|
|
// * colorFamilies |
|
|
|
// * "colorFamilies" |
|
|
|
// * colors |
|
|
|
// * "colors" |
|
|
|
// * sizes |
|
|
|
// * "sizes" |
|
|
|
// * materials |
|
|
|
// * "materials" |
|
|
|
// * patterns |
|
|
|
// * "patterns" |
|
|
|
// * conditions |
|
|
|
// * "conditions" |
|
|
|
// * attributes.key |
|
|
|
// * "attributes.key" |
|
|
|
// * pickupInStore |
|
|
|
// * "pickupInStore" |
|
|
|
// * shipToStore |
|
|
|
// * "shipToStore" |
|
|
|
// * sameDayDelivery |
|
|
|
// * "sameDayDelivery" |
|
|
|
// * nextDayDelivery |
|
|
|
// * "nextDayDelivery" |
|
|
|
// * customFulfillment1 |
|
|
|
// * "customFulfillment1" |
|
|
|
// * customFulfillment2 |
|
|
|
// * "customFulfillment2" |
|
|
|
// * customFulfillment3 |
|
|
|
// * "customFulfillment3" |
|
|
|
// * customFulfillment4 |
|
|
|
// * "customFulfillment4" |
|
|
|
// * customFulfillment5 |
|
|
|
// * "customFulfillment5" |
|
|
|
// |
|
|
|
// |
|
|
|
// Numeric facet keys: |
|
|
|
// * numerical_field = |
|
|
|
// * price |
|
|
|
// * "price" |
|
|
|
// * discount |
|
|
|
// * "discount" |
|
|
|
// * rating |
|
|
|
// * "rating" |
|
|
|
// * ratingCount |
|
|
|
// * "ratingCount" |
|
|
|
// * attributes.key |
|
|
|
// * "attributes.key" |
|
|
|
string key = 1 [(google.api.field_behavior) = REQUIRED]; |
|
|
|
string key = 1 [(google.api.field_behavior) = REQUIRED]; |
|
|
|
|
|
|
|
|
|
|
|
// Set only if values should be bucketized into intervals. Must be set |
|
|
|
// Set only if values should be bucketized into intervals. Must be set |
|
|
@ -167,7 +167,8 @@ message SearchRequest { |
|
|
|
// order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical |
|
|
|
// order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical |
|
|
|
// intervals are sorted in the order given by |
|
|
|
// intervals are sorted in the order given by |
|
|
|
// [FacetSpec.FacetKey.intervals][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.intervals]; |
|
|
|
// [FacetSpec.FacetKey.intervals][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.intervals]; |
|
|
|
// [FulfillmentInfo.ids][] are sorted in the order given by |
|
|
|
// [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids] |
|
|
|
|
|
|
|
// are sorted in the order given by |
|
|
|
// [FacetSpec.FacetKey.restricted_values][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.restricted_values]. |
|
|
|
// [FacetSpec.FacetKey.restricted_values][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.restricted_values]. |
|
|
|
string order_by = 4; |
|
|
|
string order_by = 4; |
|
|
|
|
|
|
|
|
|
|
@ -289,12 +290,11 @@ message SearchRequest { |
|
|
|
// Examples: |
|
|
|
// Examples: |
|
|
|
// |
|
|
|
// |
|
|
|
// * To boost products with product ID "product_1" or "product_2", and |
|
|
|
// * To boost products with product ID "product_1" or "product_2", and |
|
|
|
// color "Red" or "Blue": |
|
|
|
// color |
|
|
|
// ``` |
|
|
|
// "Red" or "Blue":<br> |
|
|
|
// (id: ANY("product_1", "product_2")) |
|
|
|
// *(id: ANY("product_1", "product_2"))<br>* |
|
|
|
// AND |
|
|
|
// *AND<br>* |
|
|
|
// (colorFamilies: ANY("Red", "Blue")) |
|
|
|
// *(colorFamilies: ANY("Red", "Blue"))<br>* |
|
|
|
// ``` |
|
|
|
|
|
|
|
string condition = 1; |
|
|
|
string condition = 1; |
|
|
|
|
|
|
|
|
|
|
|
// Strength of the condition boost, which should be in [-1, 1]. Negative |
|
|
|
// Strength of the condition boost, which should be in [-1, 1]. Negative |
|
|
@ -345,6 +345,11 @@ message SearchRequest { |
|
|
|
// The condition under which query expansion should occur. Default to |
|
|
|
// The condition under which query expansion should occur. Default to |
|
|
|
// [Condition.DISABLED][google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition.DISABLED]. |
|
|
|
// [Condition.DISABLED][google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition.DISABLED]. |
|
|
|
Condition condition = 1; |
|
|
|
Condition condition = 1; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Whether to pin unexpanded results. If this field is set to true, |
|
|
|
|
|
|
|
// unexpanded products are always at the top of the search results, followed |
|
|
|
|
|
|
|
// by the expanded results. |
|
|
|
|
|
|
|
bool pin_unexpanded_results = 2; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// The relevance threshold of the search results. The higher relevance |
|
|
|
// The relevance threshold of the search results. The higher relevance |
|
|
@ -433,7 +438,8 @@ message SearchRequest { |
|
|
|
|
|
|
|
|
|
|
|
// The filter syntax consists of an expression language for constructing a |
|
|
|
// The filter syntax consists of an expression language for constructing a |
|
|
|
// predicate from one or more fields of the products being filtered. Filter |
|
|
|
// predicate from one or more fields of the products being filtered. Filter |
|
|
|
// expression is case-sensitive. |
|
|
|
// expression is case-sensitive. See more details at this [user |
|
|
|
|
|
|
|
// guide](/retail/private/docs/filter-and-order#filter). |
|
|
|
// |
|
|
|
// |
|
|
|
// If this field is unrecognizable, an INVALID_ARGUMENT is returned. |
|
|
|
// If this field is unrecognizable, an INVALID_ARGUMENT is returned. |
|
|
|
string filter = 10; |
|
|
|
string filter = 10; |
|
|
@ -452,7 +458,9 @@ message SearchRequest { |
|
|
|
|
|
|
|
|
|
|
|
// The order in which products are returned. Products can be ordered by |
|
|
|
// The order in which products are returned. Products can be ordered by |
|
|
|
// a field in an [Product][google.cloud.retail.v2alpha.Product] object. Leave |
|
|
|
// a field in an [Product][google.cloud.retail.v2alpha.Product] object. Leave |
|
|
|
// it unset if ordered by relevance. OrderBy expression is case-sensitive. |
|
|
|
// it unset if ordered by relevance. OrderBy expression is case-sensitive. See |
|
|
|
|
|
|
|
// more details at this [user |
|
|
|
|
|
|
|
// guide](/retail/private/docs/filter-and-order#order). |
|
|
|
// |
|
|
|
// |
|
|
|
// If this field is unrecognizable, an INVALID_ARGUMENT is returned. |
|
|
|
// If this field is unrecognizable, an INVALID_ARGUMENT is returned. |
|
|
|
string order_by = 11; |
|
|
|
string order_by = 11; |
|
|
@ -466,16 +474,17 @@ message SearchRequest { |
|
|
|
// The specification for dynamically generated facets. Notice that only |
|
|
|
// The specification for dynamically generated facets. Notice that only |
|
|
|
// textual facets can be dynamically generated. |
|
|
|
// textual facets can be dynamically generated. |
|
|
|
// |
|
|
|
// |
|
|
|
// This feature requires additional allowlisting. Contact Retail Support |
|
|
|
// This feature requires additional allowlisting. Contact Retail Search |
|
|
|
// (retail-search-support@google.com) if you are interested in using dynamic |
|
|
|
// support team if you are interested in using dynamic facet feature. |
|
|
|
// facet feature. |
|
|
|
|
|
|
|
DynamicFacetSpec dynamic_facet_spec = 21; |
|
|
|
DynamicFacetSpec dynamic_facet_spec = 21; |
|
|
|
|
|
|
|
|
|
|
|
// Boost specification to boost certain products. |
|
|
|
// Boost specification to boost certain products. See more details at this |
|
|
|
|
|
|
|
// [user guide](/retail/private/docs/boosting). |
|
|
|
BoostSpec boost_spec = 13; |
|
|
|
BoostSpec boost_spec = 13; |
|
|
|
|
|
|
|
|
|
|
|
// The query expansion specification that specifies the conditions under which |
|
|
|
// The query expansion specification that specifies the conditions under which |
|
|
|
// query expansion will occur. |
|
|
|
// query expansion will occur. See more details at this [user |
|
|
|
|
|
|
|
// guide](/retail/private/docs/result-size#query_expansion). |
|
|
|
QueryExpansionSpec query_expansion_spec = 14; |
|
|
|
QueryExpansionSpec query_expansion_spec = 14; |
|
|
|
|
|
|
|
|
|
|
|
// The relevance threshold of the search results. |
|
|
|
// The relevance threshold of the search results. |
|
|
@ -483,7 +492,8 @@ message SearchRequest { |
|
|
|
// Defaults to |
|
|
|
// Defaults to |
|
|
|
// [RelevanceThreshold.HIGH][google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold.HIGH], |
|
|
|
// [RelevanceThreshold.HIGH][google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold.HIGH], |
|
|
|
// which means only the most relevant results are shown, and the least number |
|
|
|
// which means only the most relevant results are shown, and the least number |
|
|
|
// of results are returned. |
|
|
|
// of results are returned. See more details at this [user |
|
|
|
|
|
|
|
// guide](/retail/private/docs/result-size#relevance_thresholding). |
|
|
|
RelevanceThreshold relevance_threshold = 15; |
|
|
|
RelevanceThreshold relevance_threshold = 15; |
|
|
|
|
|
|
|
|
|
|
|
// The keys to fetch and rollup the matching |
|
|
|
// The keys to fetch and rollup the matching |
|
|
@ -497,10 +507,9 @@ message SearchRequest { |
|
|
|
// [Product][google.cloud.retail.v2alpha.Product]s attributes will lead to |
|
|
|
// [Product][google.cloud.retail.v2alpha.Product]s attributes will lead to |
|
|
|
// extra query latency. Maximum number of keys is 10. |
|
|
|
// extra query latency. Maximum number of keys is 10. |
|
|
|
// |
|
|
|
// |
|
|
|
// For |
|
|
|
// For [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo], a |
|
|
|
// [Product.fulfillment_info][google.cloud.retail.v2alpha.Product.fulfillment_info], |
|
|
|
// fulfillment type and a fulfillment ID must be provided in the format of |
|
|
|
// a fulfillment type and a fulfillment ID must be provided in the format of |
|
|
|
// "fulfillmentType.fulfillmentId". E.g., in "pickupInStore.store123", |
|
|
|
// "fulfillmentType.filfillmentId". E.g., in "pickupInStore.store123", |
|
|
|
|
|
|
|
// "pickupInStore" is fulfillment type and "store123" is the store ID. |
|
|
|
// "pickupInStore" is fulfillment type and "store123" is the store ID. |
|
|
|
// |
|
|
|
// |
|
|
|
// Supported keys are: |
|
|
|
// Supported keys are: |
|
|
@ -511,24 +520,51 @@ message SearchRequest { |
|
|
|
// * discount |
|
|
|
// * discount |
|
|
|
// * attributes.key, where key is any key in the |
|
|
|
// * attributes.key, where key is any key in the |
|
|
|
// [Product.attributes][google.cloud.retail.v2alpha.Product.attributes] map. |
|
|
|
// [Product.attributes][google.cloud.retail.v2alpha.Product.attributes] map. |
|
|
|
// * pickupInStore.id, where id is any [FulfillmentInfo.ids][] for type |
|
|
|
// * pickupInStore.id, where id is any |
|
|
|
// [FulfillmentInfo.Type.PICKUP_IN_STORE][]. |
|
|
|
// [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids] |
|
|
|
// * shipToStore.id, where id is any [FulfillmentInfo.ids][] for type |
|
|
|
// for |
|
|
|
// [FulfillmentInfo.Type.SHIP_TO_STORE][]. |
|
|
|
// [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type] |
|
|
|
// * sameDayDelivery.id, where id is any [FulfillmentInfo.ids][] for type |
|
|
|
// "pickup-in-store". |
|
|
|
// [FulfillmentInfo.Type.SAME_DAY_DELIVERY][]. |
|
|
|
// * shipToStore.id, where id is any |
|
|
|
// * nextDayDelivery.id, where id is any [FulfillmentInfo.ids][] for type |
|
|
|
// [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids] |
|
|
|
// [FulfillmentInfo.Type.NEXT_DAY_DELIVERY][]. |
|
|
|
// for |
|
|
|
// * customFulfillment1.id, where id is any [FulfillmentInfo.ids][] for type |
|
|
|
// [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type] |
|
|
|
// [FulfillmentInfo.Type.CUSTOM_TYPE_1][]. |
|
|
|
// "ship-to-store". |
|
|
|
// * customFulfillment2.id, where id is any [FulfillmentInfo.ids][] for type |
|
|
|
// * sameDayDelivery.id, where id is any |
|
|
|
// [FulfillmentInfo.Type.CUSTOM_TYPE_2][]. |
|
|
|
// [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids] |
|
|
|
// * customFulfillment3.id, where id is any [FulfillmentInfo.ids][] for type |
|
|
|
// for |
|
|
|
// [FulfillmentInfo.Type.CUSTOM_TYPE_3][]. |
|
|
|
// [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type] |
|
|
|
// * customFulfillment4.id, where id is any [FulfillmentInfo.ids][] for type |
|
|
|
// "same-day-delivery". |
|
|
|
// [FulfillmentInfo.Type.CUSTOM_TYPE_4][]. |
|
|
|
// * nextDayDelivery.id, where id is any |
|
|
|
// * customFulfillment5.id, where id is any [FulfillmentInfo.ids][] for type |
|
|
|
// [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids] |
|
|
|
// [FulfillmentInfo.Type.CUSTOM_TYPE_5][]. |
|
|
|
// for |
|
|
|
|
|
|
|
// [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type] |
|
|
|
|
|
|
|
// "next-day-delivery". |
|
|
|
|
|
|
|
// * customFulfillment1.id, where id is any |
|
|
|
|
|
|
|
// [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids] |
|
|
|
|
|
|
|
// for |
|
|
|
|
|
|
|
// [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type] |
|
|
|
|
|
|
|
// "custom-type-1". |
|
|
|
|
|
|
|
// * customFulfillment2.id, where id is any |
|
|
|
|
|
|
|
// [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids] |
|
|
|
|
|
|
|
// for |
|
|
|
|
|
|
|
// [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type] |
|
|
|
|
|
|
|
// "custom-type-2". |
|
|
|
|
|
|
|
// * customFulfillment3.id, where id is any |
|
|
|
|
|
|
|
// [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids] |
|
|
|
|
|
|
|
// for |
|
|
|
|
|
|
|
// [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type] |
|
|
|
|
|
|
|
// "custom-type-3". |
|
|
|
|
|
|
|
// * customFulfillment4.id, where id is any |
|
|
|
|
|
|
|
// [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids] |
|
|
|
|
|
|
|
// for |
|
|
|
|
|
|
|
// [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type] |
|
|
|
|
|
|
|
// "custom-type-4". |
|
|
|
|
|
|
|
// * customFulfillment5.id, where id is any |
|
|
|
|
|
|
|
// [FulfillmentInfo.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids] |
|
|
|
|
|
|
|
// for |
|
|
|
|
|
|
|
// [FulfillmentInfo.type][google.cloud.retail.v2alpha.FulfillmentInfo.type] |
|
|
|
|
|
|
|
// "custom-type-5". |
|
|
|
// |
|
|
|
// |
|
|
|
// If this field is set to an invalid value other than these, an |
|
|
|
// If this field is set to an invalid value other than these, an |
|
|
|
// INVALID_ARGUMENT error is returned. |
|
|
|
// INVALID_ARGUMENT error is returned. |
|
|
@ -620,9 +656,8 @@ message SearchResponse { |
|
|
|
// } |
|
|
|
// } |
|
|
|
// } |
|
|
|
// } |
|
|
|
// |
|
|
|
// |
|
|
|
// For |
|
|
|
// For [FulfillmentInfo][google.cloud.retail.v2alpha.FulfillmentInfo], the |
|
|
|
// [Product.fulfillment_info][google.cloud.retail.v2alpha.Product.fulfillment_info], |
|
|
|
// rollup values is a double value with type |
|
|
|
// the rollup values is a double value with type |
|
|
|
|
|
|
|
// [google.protobuf.Value][google.protobuf.Value]. For example, |
|
|
|
// [google.protobuf.Value][google.protobuf.Value]. For example, |
|
|
|
// `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there |
|
|
|
// `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there |
|
|
|
// are 10 variants in this product are available in the store "store1". |
|
|
|
// are 10 variants in this product are available in the store "store1". |
|
|
@ -662,6 +697,11 @@ message SearchResponse { |
|
|
|
message QueryExpansionInfo { |
|
|
|
message QueryExpansionInfo { |
|
|
|
// Bool describing whether query expansion has occurred. |
|
|
|
// Bool describing whether query expansion has occurred. |
|
|
|
bool expanded_query = 1; |
|
|
|
bool expanded_query = 1; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Number of pinned results. This field will only be set when expansion |
|
|
|
|
|
|
|
// happens and [SearchRequest.query_expansion_spec.pin_unexpanded_results][] |
|
|
|
|
|
|
|
// is set to true. |
|
|
|
|
|
|
|
int64 pinned_result_count = 2; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// A list of matched items. The order represents the ranking. |
|
|
|
// A list of matched items. The order represents the ranking. |
|
|
|