feat: support merged facets

feat: add product purge API
feat: add branch and project APIs to alpha
feat: add page_categories to control condition
feat: support attribute suggestion in autocomplete
feat: support frequent bought together model config
feat: allow to skip denylist postfiltering in recommendations
chore: deprecate recent search result in autocomplete
docs: keep the API doc up-to-date with recent changes

PiperOrigin-RevId: 641040423
This commit is contained in:
Google APIs 2024-06-06 15:28:50 -07:00 committed by Copybara-Service
parent 8cd2212ef6
commit a32cd99cdb
20 changed files with 1292 additions and 154 deletions

View file

@ -9,19 +9,24 @@
# * extra_protoc_file_parameters
# The complete list of preserved parameters can be found in the source code.
# buildifier: disable=load-on-top
# This is an API workspace, having public visibility by default makes perfect sense.
package(default_visibility = ["//visibility:public"])
##############################################################################
# Common
##############################################################################
load("@rules_proto//proto:defs.bzl", "proto_library")
# buildifier: disable=same-origin-load
load("@com_google_googleapis_imports//:imports.bzl", "proto_library_with_info")
load("@rules_proto//proto:defs.bzl", "proto_library")
proto_library(
name = "retail_proto",
srcs = [
"analytics_service.proto",
"branch.proto",
"branch_service.proto",
"catalog.proto",
"catalog_service.proto",
"common.proto",
@ -37,6 +42,8 @@ proto_library(
"prediction_service.proto",
"product.proto",
"product_service.proto",
"project.proto",
"project_service.proto",
"promotion.proto",
"purge_config.proto",
"search_service.proto",
@ -68,12 +75,14 @@ proto_library_with_info(
deps = [
":retail_proto",
"//google/cloud:common_resources_proto",
"//google/cloud/location:location_proto",
],
)
##############################################################################
# Java
##############################################################################
# buildifier: disable=same-origin-load
load(
"@com_google_googleapis_imports//:imports.bzl",
"java_gapic_assembly_gradle_pkg",
@ -103,11 +112,13 @@ java_gapic_library(
service_yaml = "retail_v2alpha.yaml",
test_deps = [
":retail_java_grpc",
"//google/cloud/location:location_java_grpc",
],
transport = "grpc+rest",
deps = [
":retail_java_proto",
"//google/api:api_java_proto",
"//google/cloud/location:location_java_proto",
],
)
@ -116,6 +127,8 @@ java_gapic_test(
test_classes = [
"com.google.cloud.retail.v2alpha.AnalyticsServiceClientHttpJsonTest",
"com.google.cloud.retail.v2alpha.AnalyticsServiceClientTest",
"com.google.cloud.retail.v2alpha.BranchServiceClientHttpJsonTest",
"com.google.cloud.retail.v2alpha.BranchServiceClientTest",
"com.google.cloud.retail.v2alpha.CatalogServiceClientHttpJsonTest",
"com.google.cloud.retail.v2alpha.CatalogServiceClientTest",
"com.google.cloud.retail.v2alpha.CompletionServiceClientHttpJsonTest",
@ -130,6 +143,8 @@ java_gapic_test(
"com.google.cloud.retail.v2alpha.PredictionServiceClientTest",
"com.google.cloud.retail.v2alpha.ProductServiceClientHttpJsonTest",
"com.google.cloud.retail.v2alpha.ProductServiceClientTest",
"com.google.cloud.retail.v2alpha.ProjectServiceClientHttpJsonTest",
"com.google.cloud.retail.v2alpha.ProjectServiceClientTest",
"com.google.cloud.retail.v2alpha.SearchServiceClientHttpJsonTest",
"com.google.cloud.retail.v2alpha.SearchServiceClientTest",
"com.google.cloud.retail.v2alpha.ServingConfigServiceClientHttpJsonTest",
@ -156,6 +171,7 @@ java_gapic_assembly_gradle_pkg(
##############################################################################
# Go
##############################################################################
# buildifier: disable=same-origin-load
load(
"@com_google_googleapis_imports//:imports.bzl",
"go_gapic_assembly_pkg",
@ -190,6 +206,7 @@ go_gapic_library(
deps = [
":retail_go_proto",
"//google/api:httpbody_go_proto",
"//google/cloud/location:location_go_proto",
"//google/longrunning:longrunning_go_proto",
"@com_google_cloud_go_longrunning//:go_default_library",
"@com_google_cloud_go_longrunning//autogen:go_default_library",
@ -213,6 +230,7 @@ go_gapic_assembly_pkg(
##############################################################################
# Python
##############################################################################
# buildifier: disable=same-origin-load
load(
"@com_google_googleapis_imports//:imports.bzl",
"py_gapic_assembly_pkg",
@ -227,6 +245,8 @@ py_gapic_library(
rest_numeric_enums = True,
service_yaml = "retail_v2alpha.yaml",
transport = "grpc+rest",
deps = [
],
)
py_test(
@ -250,6 +270,7 @@ py_gapic_assembly_pkg(
##############################################################################
# PHP
##############################################################################
# buildifier: disable=same-origin-load
load(
"@com_google_googleapis_imports//:imports.bzl",
"php_gapic_assembly_pkg",
@ -266,10 +287,13 @@ php_gapic_library(
name = "retail_php_gapic",
srcs = [":retail_proto_with_info"],
grpc_service_config = "retail_grpc_service_config.json",
migration_mode = "PRE_MIGRATION_SURFACE_ONLY",
rest_numeric_enums = True,
service_yaml = "retail_v2alpha.yaml",
transport = "grpc+rest",
deps = [":retail_php_proto"],
deps = [
":retail_php_proto",
],
)
# Open Source Packages
@ -284,6 +308,7 @@ php_gapic_assembly_pkg(
##############################################################################
# Node.js
##############################################################################
# buildifier: disable=same-origin-load
load(
"@com_google_googleapis_imports//:imports.bzl",
"nodejs_gapic_assembly_pkg",
@ -315,6 +340,7 @@ nodejs_gapic_assembly_pkg(
##############################################################################
# Ruby
##############################################################################
# buildifier: disable=same-origin-load
load(
"@com_google_googleapis_imports//:imports.bzl",
"ruby_cloud_gapic_library",
@ -369,6 +395,7 @@ ruby_gapic_assembly_pkg(
##############################################################################
# C#
##############################################################################
# buildifier: disable=same-origin-load
load(
"@com_google_googleapis_imports//:imports.bzl",
"csharp_gapic_assembly_pkg",
@ -379,6 +406,7 @@ load(
csharp_proto_library(
name = "retail_csharp_proto",
extra_opts = [],
deps = [":retail_proto"],
)
@ -415,6 +443,7 @@ csharp_gapic_assembly_pkg(
##############################################################################
# C++
##############################################################################
# buildifier: disable=same-origin-load
load(
"@com_google_googleapis_imports//:imports.bzl",
"cc_grpc_library",

View file

@ -0,0 +1,245 @@
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.cloud.retail.v2alpha;
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/cloud/retail/v2alpha/product.proto";
import "google/protobuf/timestamp.proto";
option csharp_namespace = "Google.Cloud.Retail.V2Alpha";
option go_package = "cloud.google.com/go/retail/apiv2alpha/retailpb;retailpb";
option java_multiple_files = true;
option java_outer_classname = "BranchProto";
option java_package = "com.google.cloud.retail.v2alpha";
option objc_class_prefix = "RETAIL";
option php_namespace = "Google\\Cloud\\Retail\\V2alpha";
option ruby_package = "Google::Cloud::Retail::V2alpha";
// A view that specifies different level of fields of a
// [Branch][google.cloud.retail.v2alpha.Branch] to show in responses.
enum BranchView {
// The value when it's unspecified. This defaults to the BASIC view.
BRANCH_VIEW_UNSPECIFIED = 0;
// Includes basic metadata about the branch, but not statistical fields.
// See documentation of fields of [Branch][google.cloud.retail.v2alpha.Branch]
// to find what fields are excluded from BASIC view.
BRANCH_VIEW_BASIC = 1;
// Includes all fields of a [Branch][google.cloud.retail.v2alpha.Branch].
BRANCH_VIEW_FULL = 2;
}
// A data branch that stores [Product][google.cloud.retail.v2alpha.Product]s.
message Branch {
option (google.api.resource) = {
type: "retail.googleapis.com/Branch"
pattern: "projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}"
};
// A statistic about the number of products in a branch.
message ProductCountStatistic {
// Scope of what products are included for this count.
enum ProductCountScope {
// Default value for enum. This value is not used in the API response.
PRODUCT_COUNT_SCOPE_UNSPECIFIED = 0;
// Scope for all existing products in the branch. Useful for understanding
// how many products there are in a branch.
ALL_PRODUCTS = 1;
// Scope for products created or updated in the last 24 hours.
LAST_24_HOUR_UPDATE = 2;
}
// [ProductCountScope] of the [counts].
ProductCountScope scope = 1;
// The number of products in
// [scope][google.cloud.retail.v2alpha.Branch.ProductCountStatistic.scope]
// broken down into different groups.
//
// The key is a group representing a set of products, and the value is the
// number of products in that group.
// Note: keys in this map may change over time.
//
// Possible keys:
// * "primary-in-stock", products have
// [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
// type and
// [Product.Availability.IN_STOCK][google.cloud.retail.v2alpha.Product.Availability.IN_STOCK]
// availability.
//
// * "primary-out-of-stock", products have
// [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
// type and
// [Product.Availability.OUT_OF_STOCK][google.cloud.retail.v2alpha.Product.Availability.OUT_OF_STOCK]
// availability.
//
// * "primary-preorder", products have
// [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
// type and
// [Product.Availability.PREORDER][google.cloud.retail.v2alpha.Product.Availability.PREORDER]
// availability.
//
// * "primary-backorder", products have
// [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]
// type and
// [Product.Availability.BACKORDER][google.cloud.retail.v2alpha.Product.Availability.BACKORDER]
// availability.
//
// * "variant-in-stock", products have
// [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
// type and
// [Product.Availability.IN_STOCK][google.cloud.retail.v2alpha.Product.Availability.IN_STOCK]
// availability.
//
// * "variant-out-of-stock", products have
// [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
// type and
// [Product.Availability.OUT_OF_STOCK][google.cloud.retail.v2alpha.Product.Availability.OUT_OF_STOCK]
// availability.
//
// * "variant-preorder", products have
// [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
// type and
// [Product.Availability.PREORDER][google.cloud.retail.v2alpha.Product.Availability.PREORDER]
// availability.
//
// * "variant-backorder", products have
// [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]
// type and
// [Product.Availability.BACKORDER][google.cloud.retail.v2alpha.Product.Availability.BACKORDER]
// availability.
//
// * "price-discounted", products have [Product.price_info.price] <
// [Product.price_info.original_price].
map<string, int64> counts = 2;
}
// Metric measured on a group of
// [Product][google.cloud.retail.v2alpha.Product]s against a certain quality
// requirement. Contains the number of products that pass the check and the
// number of products that don't.
message QualityMetric {
// The key that represents a quality requirement rule.
//
// Supported keys:
// * "has-valid-uri": product has a valid and accessible
// [uri][google.cloud.retail.v2alpha.Product.uri].
//
// * "available-expire-time-conformance":
// [Product.available_time][google.cloud.retail.v2alpha.Product.available_time]
// is early than "now", and
// [Product.expire_time][google.cloud.retail.v2alpha.Product.expire_time] is
// greater than "now".
//
// * "has-searchable-attributes": product has at least one
// [attribute][google.cloud.retail.v2alpha.Product.attributes] set to
// searchable.
//
// * "has-description": product has non-empty
// [description][google.cloud.retail.v2alpha.Product.description].
//
// * "has-at-least-bigram-title": Product
// [title][google.cloud.retail.v2alpha.Product.title] has at least two
// words. A comprehensive title helps to improve search quality.
//
// * "variant-has-image": the
// [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT] products has
// at least one [image][google.cloud.retail.v2alpha.Product.images]. You may
// ignore this metric if all your products are at
// [primary][google.cloud.retail.v2alpha.Product.Type.PRIMARY] level.
//
// * "variant-has-price-info": the
// [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT] products has
// [price_info][google.cloud.retail.v2alpha.Product.price_info] set. You may
// ignore this metric if all your products are at
// [primary][google.cloud.retail.v2alpha.Product.Type.PRIMARY] level.
//
// * "has-publish-time": product has non-empty
// [publish_time][google.cloud.retail.v2alpha.Product.publish_time].
string requirement_key = 1;
// Number of products passing the quality requirement check. We only check
// searchable products.
int32 qualified_product_count = 2;
// Number of products failing the quality requirement check. We only check
// searchable products.
int32 unqualified_product_count = 3;
// Value from 0 to 100 representing the suggested percentage of products
// that meet the quality requirements to get good search and recommendation
// performance. 100 * (qualified_product_count) /
// (qualified_product_count + unqualified_product_count) should be greater
// or equal to this suggestion.
double suggested_quality_percent_threshold = 4;
// A list of a maximum of 100 sample products that do not qualify for
// this requirement.
//
// This field is only populated in the response to
// [BranchService.GetBranch][google.cloud.retail.v2alpha.BranchService.GetBranch]
// API, and is always empty for
// [BranchService.ListBranches][google.cloud.retail.v2alpha.BranchService.ListBranches].
//
// Only the following fields are set in the
// [Product][google.cloud.retail.v2alpha.Product].
//
// * [Product.name][google.cloud.retail.v2alpha.Product.name]
// * [Product.id][google.cloud.retail.v2alpha.Product.id]
// * [Product.title][google.cloud.retail.v2alpha.Product.title]
repeated Product unqualified_sample_products = 5;
}
// Immutable. Full resource name of the branch, such as
// `projects/*/locations/global/catalogs/default_catalog/branches/branch_id`.
string name = 1 [(google.api.field_behavior) = IMMUTABLE];
// Output only. Human readable name of the branch to display in the UI.
string display_name = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. Indicates whether this branch is set as the default branch of
// its parent catalog.
bool is_default = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. Timestamp of last import through
// [ProductService.ImportProducts][google.cloud.retail.v2alpha.ProductService.ImportProducts].
// Empty value means no import has been made to this branch.
google.protobuf.Timestamp last_product_import_time = 5
[(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. Statistics for number of products in the branch, provided for
// different
// [scopes][google.cloud.retail.v2alpha.Branch.ProductCountStatistic.ProductCountScope].
//
// This field is not populated in [BranchView.BASIC][] view.
repeated ProductCountStatistic product_count_stats = 7
[(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. The quality metrics measured among products of this branch.
//
// See
// [QualityMetric.requirement_key][google.cloud.retail.v2alpha.Branch.QualityMetric.requirement_key]
// for supported metrics. Metrics could be missing if failed to retrieve.
//
// This field is not populated in [BranchView.BASIC][] view.
repeated QualityMetric quality_metrics = 6
[(google.api.field_behavior) = OUTPUT_ONLY];
}

View file

@ -0,0 +1,111 @@
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.cloud.retail.v2alpha;
import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/cloud/retail/v2alpha/branch.proto";
option csharp_namespace = "Google.Cloud.Retail.V2Alpha";
option go_package = "cloud.google.com/go/retail/apiv2alpha/retailpb;retailpb";
option java_multiple_files = true;
option java_outer_classname = "BranchServiceProto";
option java_package = "com.google.cloud.retail.v2alpha";
option objc_class_prefix = "RETAIL";
option php_namespace = "Google\\Cloud\\Retail\\V2alpha";
option ruby_package = "Google::Cloud::Retail::V2alpha";
// Service for [Branch][google.cloud.retail.v2alpha.Branch] Management
//
// [Branch][google.cloud.retail.v2alpha.Branch]es are automatically created when
// a [Catalog][google.cloud.retail.v2alpha.Catalog] is created. There are fixed
// three branches in each catalog, and may use
// [ListBranches][google.cloud.retail.v2alpha.BranchService.ListBranches] method
// to get the details of all branches.
service BranchService {
option (google.api.default_host) = "retail.googleapis.com";
option (google.api.oauth_scopes) =
"https://www.googleapis.com/auth/cloud-platform";
// Lists all [Branch][google.cloud.retail.v2alpha.Branch]s under the specified
// parent [Catalog][google.cloud.retail.v2alpha.Catalog].
rpc ListBranches(ListBranchesRequest) returns (ListBranchesResponse) {
option (google.api.http) = {
get: "/v2alpha/{parent=projects/*/locations/*/catalogs/*}/branches"
};
option (google.api.method_signature) = "parent";
}
// Retrieves a [Branch][google.cloud.retail.v2alpha.Branch].
rpc GetBranch(GetBranchRequest) returns (Branch) {
option (google.api.http) = {
get: "/v2alpha/{name=projects/*/locations/*/catalogs/*/branches/*}"
};
option (google.api.method_signature) = "name";
}
}
// Request for
// [BranchService.ListBranches][google.cloud.retail.v2alpha.BranchService.ListBranches]
// method.
message ListBranchesRequest {
// Required. The parent catalog resource name.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = { type: "retail.googleapis.com/Catalog" }
];
// The view to apply to the returned
// [Branch][google.cloud.retail.v2alpha.Branch]. Defaults to
// [Branch.BranchView.BASIC] if unspecified.
// See documentation of fields of [Branch][google.cloud.retail.v2alpha.Branch]
// to find what fields are excluded from BASIC view.
BranchView view = 2;
}
// Response for
// [BranchService.ListBranches][google.cloud.retail.v2alpha.BranchService.ListBranches]
// method.
message ListBranchesResponse {
// The Branches.
repeated Branch branches = 1;
}
// Request for
// [BranchService.GetBranch][google.cloud.retail.v2alpha.BranchService.GetBranch]
// method.
message GetBranchRequest {
// Required. The name of the branch to retrieve.
// Format:
// `projects/*/locations/global/catalogs/default_catalog/branches/some_branch_id`.
//
// "default_branch" can be used as a special branch_id, it returns the
// default branch that has been set for the catalog.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = { type: "retail.googleapis.com/Branch" }
];
// The view to apply to the returned
// [Branch][google.cloud.retail.v2alpha.Branch]. Defaults to
// [Branch.BranchView.BASIC] if unspecified.
// See documentation of fields of [Branch][google.cloud.retail.v2alpha.Branch]
// to find what fields are excluded from BASIC view.
BranchView view = 2;
}

View file

@ -20,6 +20,7 @@ import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/cloud/retail/v2alpha/common.proto";
import "google/cloud/retail/v2alpha/import_config.proto";
import "google/protobuf/timestamp.proto";
option csharp_namespace = "Google.Cloud.Retail.V2Alpha";
option go_package = "cloud.google.com/go/retail/apiv2alpha/retailpb;retailpb";
@ -87,6 +88,124 @@ message ProductLevelConfig {
// Catalog level attribute config for an attribute. For example, if customers
// want to enable/disable facet for a specific attribute.
message CatalogAttribute {
// Possible options for the facet that corresponds to the current attribute
// config.
message FacetConfig {
// [Facet values][google.cloud.retail.v2alpha.SearchResponse.Facet.values]
// to ignore on [facets][google.cloud.retail.v2alpha.SearchResponse.Facet]
// during the specified time range for the given
// [SearchResponse.Facet.key][google.cloud.retail.v2alpha.SearchResponse.Facet.key]
// attribute.
message IgnoredFacetValues {
// List of facet values to ignore for the following time range. The facet
// values are the same as the attribute values. There is a limit of 10
// values per instance of IgnoredFacetValues. Each value can have at most
// 128 characters.
repeated string values = 1;
// Time range for the current list of facet values to ignore.
// If multiple time ranges are specified for an facet value for the
// current attribute, consider all of them. If both are empty, ignore
// always. If start time and end time are set, then start time
// must be before end time.
// If start time is not empty and end time is empty, then will ignore
// these facet values after the start time.
google.protobuf.Timestamp start_time = 2;
// If start time is empty and end time is not empty, then ignore these
// facet values before end time.
google.protobuf.Timestamp end_time = 3;
}
// Replaces a set of textual facet values by the same (possibly different)
// merged facet value. Each facet value should appear at most once as a
// value per
// [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]. This
// feature is available only for textual custom attributes.
message MergedFacetValue {
// All the facet values that are replaces by the same
// [merged_value][google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacetValue.merged_value]
// that follows. The maximum number of values per MergedFacetValue is 25.
// Each value can have up to 128 characters.
repeated string values = 1;
// All the previous values are replaced by this merged facet value.
// This merged_value must be non-empty and can have up to 128 characters.
string merged_value = 2;
}
// The current facet key (i.e. attribute config) maps into the
// [merged_facet_key][google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacet.merged_facet_key].
// A facet key can have at most one child. The current facet key and the
// merged facet key need both to be textual custom attributes or both
// numerical custom attributes (same type).
message MergedFacet {
// The merged facet key should be a valid facet key that is different than
// the facet key of the current catalog attribute. We refer this is
// merged facet key as the child of the current catalog attribute. This
// merged facet key can't be a parent of another facet key (i.e. no
// directed path of length 2). This merged facet key needs to be either a
// textual custom attribute or a numerical custom attribute.
string merged_facet_key = 1;
}
// Options to rerank based on facet values engaged by the user for the
// current key. That key needs to be a custom textual key and facetable.
// To use this control, you also need to pass all the facet keys engaged by
// the user in the request using the field [SearchRequest.FacetSpec]. In
// particular, if you don't pass the facet keys engaged that you want to
// rerank on, this control won't be effective. Moreover, to obtain better
// results, the facet values that you want to rerank on should be close to
// English (ideally made of words, underscores, and spaces).
message RerankConfig {
// If set to true, then we also rerank the dynamic facets based on the
// facet values engaged by the user for the current attribute key during
// serving.
bool rerank_facet = 1;
// If empty, rerank on all facet values for the current key. Otherwise,
// will rerank on the facet values from this list only.
repeated string facet_values = 2;
}
// If you don't set the facet
// [SearchRequest.FacetSpec.FacetKey.intervals][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.intervals]
// in the request to a numerical attribute, then we use the computed
// intervals with rounded bounds obtained from all its product numerical
// attribute values. The computed intervals might not be ideal for some
// attributes. Therefore, we give you the option to overwrite them with the
// facet_intervals field. The maximum of facet intervals per
// [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] is 40.
// Each interval must have a lower bound or an upper bound. If both bounds
// are provided, then the lower bound must be smaller or equal than the
// upper bound.
repeated Interval facet_intervals = 1;
// Each instance represents a list of attribute values to ignore as facet
// values for a specific time range. The maximum number of instances per
// [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] is 25.
repeated IgnoredFacetValues ignored_facet_values = 2;
// Each instance replaces a list of facet values by a merged facet
// value. If a facet value is not in any list, then it will stay the same.
// To avoid conflicts, only paths of length 1 are accepted. In other words,
// if "dark_blue" merged into "BLUE", then the latter can't merge into
// "blues" because this would create a path of length 2. The maximum number
// of instances of MergedFacetValue per
// [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] is 100.
// This feature is available only for textual custom attributes.
repeated MergedFacetValue merged_facet_values = 3;
// Use this field only if you want to merge a facet key into another facet
// key.
MergedFacet merged_facet = 4;
// Set this field only if you want to rerank based on facet values engaged
// by the user for the current key. This option is only possible for custom
// facetable textual keys.
RerankConfig rerank_config = 5;
}
// The type of an attribute.
enum AttributeType {
// The type of the attribute is unknown.
@ -211,7 +330,9 @@ message CatalogAttribute {
// are indexed so that it can be filtered, faceted, or boosted in
// [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
//
// Must be specified, otherwise throws INVALID_FORMAT error.
// Must be specified when
// [AttributesConfig.attribute_config_level][google.cloud.retail.v2alpha.AttributesConfig.attribute_config_level]
// is CATALOG_LEVEL_ATTRIBUTE_CONFIG, otherwise throws INVALID_FORMAT error.
IndexableOption indexable_option = 5;
// If DYNAMIC_FACETABLE_ENABLED, attribute values are available for dynamic
@ -233,7 +354,9 @@ message CatalogAttribute {
// [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search],
// as there are no text values associated to numerical attributes.
//
// Must be specified, otherwise throws INVALID_FORMAT error.
// Must be specified, when
// [AttributesConfig.attribute_config_level][google.cloud.retail.v2alpha.AttributesConfig.attribute_config_level]
// is CATALOG_LEVEL_ATTRIBUTE_CONFIG, otherwise throws INVALID_FORMAT error.
SearchableOption searchable_option = 7;
// When
@ -255,6 +378,9 @@ message CatalogAttribute {
// results. If unset, the server behavior defaults to
// [RETRIEVABLE_DISABLED][google.cloud.retail.v2alpha.CatalogAttribute.RetrievableOption.RETRIEVABLE_DISABLED].
RetrievableOption retrievable_option = 12;
// Contains facet options.
FacetConfig facet_config = 13;
}
// Catalog level attribute config.
@ -344,8 +470,8 @@ message CompletionConfig {
// Output only. Name of the LRO corresponding to the latest suggestion terms
// list import.
//
// Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
// retrieve the latest state of the Long Running Operation.
// Can use [GetOperation][google.longrunning.Operations.GetOperation] API
// method to retrieve the latest state of the Long Running Operation.
string last_suggestions_import_operation = 6
[(google.api.field_behavior) = OUTPUT_ONLY];
@ -375,10 +501,10 @@ message CompletionConfig {
}
// Represents a link between a Merchant Center account and a branch.
// Once a link is established, products from the linked merchant center account
// will be streamed to the linked branch.
// After a link is established, products from the linked Merchant Center account
// are streamed to the linked branch.
message MerchantCenterLink {
// Required. The linked [Merchant center account
// Required. The linked [Merchant Center account
// ID](https://developers.google.com/shopping-content/guides/accountstatuses).
// The account must be a standalone account or a sub-account of a MCA.
int64 merchant_center_account_id = 1 [(google.api.field_behavior) = REQUIRED];
@ -388,7 +514,7 @@ message MerchantCenterLink {
// empty value will use the currently configured default branch. However,
// changing the default branch later on won't change the linked branch here.
//
// A single branch ID can only have one linked merchant center account ID.
// A single branch ID can only have one linked Merchant Center account ID.
string branch_id = 2;
// String representing the destination to import for, all if left empty.
@ -470,8 +596,8 @@ message Catalog {
[(google.api.field_behavior) = REQUIRED];
// The Merchant Center linking configuration.
// Once a link is added, the data stream from Merchant Center to Cloud Retail
// After a link is added, the data stream from Merchant Center to Cloud Retail
// will be enabled automatically. The requester must have access to the
// merchant center account in order to make changes to this field.
// Merchant Center account in order to make changes to this field.
MerchantCenterLinkingConfig merchant_center_linking_config = 6;
}

View file

@ -124,6 +124,12 @@ message Condition {
// Range of time(s) specifying when Condition is active.
// Condition true if any time range matches.
repeated TimeRange active_time_range = 3;
// Used to support browse uses cases.
// A list (up to 10 entries) of categories or departments.
// The format should be the same as
// [UserEvent.page_categories][google.cloud.retail.v2alpha.UserEvent.page_categories];
repeated string page_categories = 4;
}
// A rule is a condition-action pair
@ -173,17 +179,19 @@ message Rule {
}
// * Rule Condition:
// - No
// [Condition.query_terms][google.cloud.retail.v2alpha.Condition.query_terms]
// provided is a global match.
// - 1 or more
// [Condition.query_terms][google.cloud.retail.v2alpha.Condition.query_terms]
// provided are combined with OR operator.
// - No
// [Condition.query_terms][google.cloud.retail.v2alpha.Condition.query_terms]
// provided is a global match.
// - 1 or more
// [Condition.query_terms][google.cloud.retail.v2alpha.Condition.query_terms]
// provided are combined with OR operator.
//
// * Action Input: The request query and filter that are applied to the
// retrieved products, in addition to any filters already provided with the
// SearchRequest. The AND operator is used to combine the query's existing
// filters with the filter rule(s). NOTE: May result in 0 results when
// filters conflict.
//
// * Action Result: Filters the returned objects to be ONLY those that passed
// the filter.
message FilterAction {
@ -193,9 +201,8 @@ message Rule {
// set.
// * Filter syntax is identical to
// [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter].
// See more
// details at the Retail Search
// [user guide](/retail/search/docs/filter-and-order#filter).
// For more
// information, see [Filter](/retail/docs/filter-and-order#filter).
// * To filter products with product ID "product_1" or "product_2", and
// color
// "Red" or "Blue":<br>
@ -208,7 +215,7 @@ message Rule {
// Redirects a shopper to a specific page.
//
// * Rule Condition:
// - Must specify
// Must specify
// [Condition.query_terms][google.cloud.retail.v2alpha.Condition.query_terms].
// * Action Input: Request Query
// * Action Result: Redirects shopper to provided uri.
@ -290,6 +297,78 @@ message Rule {
repeated string ignore_terms = 1;
}
// Force returns an attribute/facet in the request around a certain position
// or above.
//
// * Rule Condition:
// Must specify non-empty
// [Condition.query_terms][google.cloud.retail.v2alpha.Condition.query_terms]
// (for search only) or
// [Condition.page_categories][google.cloud.retail.v2alpha.Condition.page_categories]
// (for browse only), but can't specify both.
//
// * Action Inputs: attribute name, position
//
// * Action Result: Will force return a facet key around a certain position
// or above if the condition is satisfied.
//
// Example: Suppose the query is "shoes", the
// [Condition.query_terms][google.cloud.retail.v2alpha.Condition.query_terms]
// is "shoes", the
// [ForceReturnFacetAction.FacetPositionAdjustment.attribute_name][google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.FacetPositionAdjustment.attribute_name]
// is "size" and the
// [ForceReturnFacetAction.FacetPositionAdjustment.position][google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.FacetPositionAdjustment.position]
// is 8.
//
// Two cases: a) The facet key "size" is not already in the top 8 slots, then
// the facet "size" will appear at a position close to 8. b) The facet key
// "size" in among the top 8 positions in the request, then it will stay at
// its current rank.
message ForceReturnFacetAction {
// Each facet position adjustment consists of a single attribute name (i.e.
// facet key) along with a specified position.
message FacetPositionAdjustment {
// The attribute name to force return as a facet. Each attribute name
// should be a valid attribute name, be non-empty and contain at most 80
// characters long.
string attribute_name = 1;
// This is the position in the request as explained above. It should be
// strictly positive be at most 100.
int32 position = 2;
}
// Each instance corresponds to a force return attribute for the given
// condition. There can't be more 3 instances here.
repeated FacetPositionAdjustment facet_position_adjustments = 1;
}
// Removes an attribute/facet in the request if is present.
//
// * Rule Condition:
// Must specify non-empty
// [Condition.query_terms][google.cloud.retail.v2alpha.Condition.query_terms]
// (for search only) or
// [Condition.page_categories][google.cloud.retail.v2alpha.Condition.page_categories]
// (for browse only), but can't specify both.
//
// * Action Input: attribute name
//
// * Action Result: Will remove the attribute (as a facet) from the request
// if it is present.
//
// Example: Suppose the query is "shoes", the
// [Condition.query_terms][google.cloud.retail.v2alpha.Condition.query_terms]
// is "shoes" and the attribute name "size", then facet key "size" will be
// removed from the request (if it is present).
message RemoveFacetAction {
// The attribute names (i.e. facet keys) to remove from the dynamic facets
// (if present in the request). There can't be more 3 attribute names.
// Each attribute name should be a valid attribute name, be non-empty and
// contain at most 80 characters.
repeated string attribute_names = 1;
}
// An action must be provided.
oneof action {
// A boost action.
@ -316,6 +395,12 @@ message Rule {
// Treats a set of terms as synonyms of one another.
TwowaySynonymsAction twoway_synonyms_action = 11;
// Force returns an attribute as a facet in the request.
ForceReturnFacetAction force_return_facet_action = 12;
// Remove an attribute as a facet in the request (if present).
RemoveFacetAction remove_facet_action = 13;
}
// Required. The condition that triggers the rule.

View file

@ -157,10 +157,10 @@ message CompleteQueryRequest {
// This field is only available for "cloud-retail" dataset.
bool enable_attribute_suggestions = 9;
// The entity for customers that may run multiple different entities, domains,
// sites or regions, for example, `Google US`, `Google Ads`, `Waymo`,
// The entity for customers who run multiple entities, domains, sites, or
// regions, for example, `Google US`, `Google Ads`, `Waymo`,
// `google.com`, `youtube.com`, etc.
// If this is set, it should be exactly matched with
// If this is set, it must be an exact match with
// [UserEvent.entity][google.cloud.retail.v2alpha.UserEvent.entity] to get
// per-entity autocomplete results.
string entity = 10;
@ -187,19 +187,22 @@ message CompleteQueryResponse {
// Facet information for the suggestion term. Gives the number of items
// resulting from a search with this suggestion term for each facet.
//
// This is an experimental feature for limited customers. Please reach out
// to the support team if you would like to receive this information.
// This is an experimental feature for limited customers. If you want to
// receive this facet information, reach out to the Retail support team.
repeated SearchResponse.Facet facets = 3;
// Total number of products associated with a search with this suggestion.
//
// This is an experimental feature for limited customers. Please reach out
// to the support team if you would like to receive this information.
// This is an experimental feature for limited customers. If you want to
// receive this product count information, reach out to the Retail support
// team.
int32 total_product_count = 4;
}
// Recent search of this user.
// Deprecated: Recent search of this user.
message RecentSearchResult {
option deprecated = true;
// The recent search query.
string recent_search = 1;
}
@ -220,9 +223,9 @@ message CompleteQueryResponse {
// attribution of complete model performance.
string attribution_token = 2;
// Matched recent searches of this user. The maximum number of recent searches
// is 10. This field is a restricted feature. Contact Retail Search support
// team if you are interested in enabling it.
// Deprecated. Matched recent searches of this user. The maximum number of
// recent searches is 10. This field is a restricted feature. If you want to
// enable it, contact Retail Search support.
//
// This feature is only available when
// [CompleteQueryRequest.visitor_id][google.cloud.retail.v2alpha.CompleteQueryRequest.visitor_id]
@ -241,7 +244,7 @@ message CompleteQueryResponse {
//
// Recent searches are deduplicated. More recent searches will be reserved
// when duplication happens.
repeated RecentSearchResult recent_search_results = 3;
repeated RecentSearchResult recent_search_results = 3 [deprecated = true];
// A map of matched attribute suggestions. This field is only available for
// "cloud-retail" dataset.

View file

@ -196,7 +196,8 @@ message ImportProductsRequest {
ImportErrorsConfig errors_config = 3;
// Indicates which fields in the provided imported `products` to update. If
// not set, all fields are updated.
// not set, all fields are updated. If provided, only the existing product
// fields are updated. Missing products will not be created.
google.protobuf.FieldMask update_mask = 4;
// The mode of reconciliation between existing products and the products to be
@ -212,9 +213,14 @@ message ImportProductsRequest {
// Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. It has
// to be within the same project as
// [ImportProductsRequest.parent][google.cloud.retail.v2alpha.ImportProductsRequest.parent].
// Make sure that `service-<project
// number>@gcp-sa-retail.iam.gserviceaccount.com` has the
// `pubsub.topics.publish` IAM permission on the topic.
// Make sure that both
// `cloud-retail-customer-data-access@system.gserviceaccount.com` and
// `service-<project number>@gcp-sa-retail.iam.gserviceaccount.com`
// have the `pubsub.topics.publish` IAM permission on the topic.
//
// Only supported when
// [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2alpha.ImportProductsRequest.reconciliation_mode]
// is set to `FULL`.
string notification_pubsub_topic = 7;
// If true, this performs the FULL import even if it would delete a large

View file

@ -30,8 +30,8 @@ option php_namespace = "Google\\Cloud\\Retail\\V2alpha";
option ruby_package = "Google::Cloud::Retail::V2alpha";
// Represents a link between a Merchant Center account and a branch.
// Once a link is established, products from the linked merchant center account
// will be streamed to the linked branch.
// After a link is established, products from the linked Merchant Center account
// are streamed to the linked branch.
message MerchantCenterAccountLink {
option (google.api.resource) = {
type: "retail.googleapis.com/MerchantCenterAccountLink"
@ -88,12 +88,12 @@ message MerchantCenterAccountLink {
// The account must be a standalone account or a sub-account of a MCA.
int64 merchant_center_account_id = 2 [(google.api.field_behavior) = REQUIRED];
// Required. The branch id (e.g. 0/1/2) within the catalog that products from
// Required. The branch ID (e.g. 0/1/2) within the catalog that products from
// merchant_center_account_id are streamed to. When updating this field, an
// empty value will use the currently configured default branch. However,
// changing the default branch later on won't change the linked branch here.
//
// A single branch id can only have one linked merchant center account id.
// A single branch ID can only have one linked Merchant Center account ID.
string branch_id = 3 [(google.api.field_behavior) = REQUIRED];
// The FeedLabel used to perform filtering.
@ -122,8 +122,12 @@ message MerchantCenterAccountLink {
// Output only. Represents the state of the link.
State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. GCP project ID.
// Output only. Google Cloud project ID.
string project_id = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
// Optional. An optional arbitrary string that could be used as a tag for
// tracking link source.
string source = 10 [(google.api.field_behavior) = OPTIONAL];
}
// Common metadata related to the progress of the operations.

View file

@ -86,7 +86,7 @@ service MerchantCenterAccountLinkService {
message ListMerchantCenterAccountLinksRequest {
// Required. The parent Catalog of the resource.
// It must match this format:
// projects/{PROJECT_NUMBER}/locations/global/catalogs/{CATALOG_ID}
// `projects/{PROJECT_NUMBER}/locations/global/catalogs/{CATALOG_ID}`
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = { type: "retail.googleapis.com/Catalog" }
@ -107,7 +107,7 @@ message ListMerchantCenterAccountLinksResponse {
message CreateMerchantCenterAccountLinkRequest {
// Required. The branch resource where this MerchantCenterAccountLink will be
// created. Format:
// projects/{PROJECT_NUMBER}/locations/global/catalogs/{CATALOG_ID}}
// `projects/{PROJECT_NUMBER}/locations/global/catalogs/{CATALOG_ID}`
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = { type: "retail.googleapis.com/Catalog" }
@ -130,7 +130,7 @@ message CreateMerchantCenterAccountLinkRequest {
// method.
message DeleteMerchantCenterAccountLinkRequest {
// Required. Full resource name. Format:
// projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/merchantCenterAccountLinks/{merchant_center_account_link_id}
// `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/merchantCenterAccountLinks/{merchant_center_account_link_id}`
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {

View file

@ -253,6 +253,25 @@ message Model {
[(google.api.field_behavior) = OPTIONAL];
}
// Additional configs for the frequently-bought-together model type.
message FrequentlyBoughtTogetherFeaturesConfig {
// Optional. Specifies the context of the model when it is used in predict
// requests. Can only be set for the `frequently-bought-together` type. If
// it isn't specified, it defaults to
// [MULTIPLE_CONTEXT_PRODUCTS][google.cloud.retail.v2alpha.Model.ContextProductsType.MULTIPLE_CONTEXT_PRODUCTS].
ContextProductsType context_products_type = 2
[(google.api.field_behavior) = OPTIONAL];
}
// Additional model features config.
message ModelFeaturesConfig {
oneof type_dedicated_config {
// Additional configs for frequently-bought-together models.
FrequentlyBoughtTogetherFeaturesConfig frequently_bought_together_config =
1;
}
}
// The serving state of the model.
enum ServingState {
// Unspecified serving state.
@ -321,6 +340,22 @@ message Model {
DATA_ERROR = 2;
}
// Use single or multiple context products for recommendations.
enum ContextProductsType {
// Unspecified default value, should never be explicitly set.
// Defaults to
// [MULTIPLE_CONTEXT_PRODUCTS][google.cloud.retail.v2alpha.Model.ContextProductsType.MULTIPLE_CONTEXT_PRODUCTS].
CONTEXT_PRODUCTS_TYPE_UNSPECIFIED = 0;
// Use only a single product as context for the recommendation. Typically
// used on pages like add-to-cart or product details.
SINGLE_CONTEXT_PRODUCT = 1;
// Use one or multiple products as context for the recommendation. Typically
// used on shopping cart pages.
MULTIPLE_CONTEXT_PRODUCTS = 2;
}
// Training configuration specific to a
// [Model.type][google.cloud.retail.v2alpha.Model.type] - currently, only for
// page optimization.
@ -448,4 +483,8 @@ message Model {
// PageOptimizationConfig.
repeated ServingConfigList serving_config_lists = 19
[(google.api.field_behavior) = OUTPUT_ONLY];
// Optional. Additional model features config.
ModelFeaturesConfig model_features_config = 22
[(google.api.field_behavior) = OPTIONAL];
}

View file

@ -33,10 +33,6 @@ option java_package = "com.google.cloud.retail.v2alpha";
option objc_class_prefix = "RETAIL";
option php_namespace = "Google\\Cloud\\Retail\\V2alpha";
option ruby_package = "Google::Cloud::Retail::V2alpha";
option (google.api.resource_definition) = {
type: "retail.googleapis.com/Branch"
pattern: "projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}"
};
// Product captures all metadata information of items to be recommended or
// searched.
@ -103,24 +99,22 @@ message Product {
}
oneof expiration {
// The timestamp when this product becomes unavailable for
// [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search].
// Note that this is only applicable to
// [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] and
// [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION],
// and ignored for
// [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]. In
// general, we suggest the users to delete the stale products explicitly,
// instead of using this field to determine staleness.
// Note that this field is applied in the following ways:
//
// If it is set, the [Product][google.cloud.retail.v2alpha.Product] is not
// available for
// [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]
// after [expire_time][google.cloud.retail.v2alpha.Product.expire_time].
// However, the product can still be retrieved by
// [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct]
// and
// [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
// * If the [Product][google.cloud.retail.v2alpha.Product] is already
// expired when it is uploaded, this product
// is not indexed for search.
//
// * If the [Product][google.cloud.retail.v2alpha.Product] is not expired
// when it is uploaded, only the
// [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]'s and
// [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION]'s
// expireTime is respected, and
// [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]'s
// expireTime is not used.
//
// In general, we suggest the users to delete the stale
// products explicitly, instead of using this field to determine staleness.
//
// [expire_time][google.cloud.retail.v2alpha.Product.expire_time] must be
// later than
@ -264,9 +258,10 @@ message Product {
// INVALID_ARGUMENT error is returned.
//
// At most 250 values are allowed per
// [Product][google.cloud.retail.v2alpha.Product]. Empty values are not
// allowed. Each value must be a UTF-8 encoded string with a length limit of
// 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned.
// [Product][google.cloud.retail.v2alpha.Product] unless overridden through
// the Google Cloud console. Empty values are not allowed. Each value must be
// a UTF-8 encoded string with a length limit of 5,000 characters. Otherwise,
// an INVALID_ARGUMENT error is returned.
//
// Corresponding properties: Google Merchant Center property
// [google_product_category][mc_google_product_category]. Schema.org property
@ -288,9 +283,10 @@ message Product {
// The brands of the product.
//
// A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded
// string with a length limit of 1,000 characters. Otherwise, an
// INVALID_ARGUMENT error is returned.
// A maximum of 30 brands are allowed unless overridden through the Google
// Cloud console. Each
// brand must be a UTF-8 encoded string with a length limit of 1,000
// characters. Otherwise, an INVALID_ARGUMENT error is returned.
//
// Corresponding properties: Google Merchant Center property
// [brand](https://support.google.com/merchants/answer/6324351). Schema.org

View file

@ -196,10 +196,11 @@ service ProductService {
};
}
// It is recommended to use the
// We recommend that you use the
// [ProductService.AddLocalInventories][google.cloud.retail.v2alpha.ProductService.AddLocalInventories]
// method instead of
// [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.AddFulfillmentPlaces].
// method instead of the
// [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.AddFulfillmentPlaces]
// method.
// [ProductService.AddLocalInventories][google.cloud.retail.v2alpha.ProductService.AddLocalInventories]
// achieves the same results but provides more fine-grained control over
// ingesting local inventory data.
@ -238,10 +239,11 @@ service ProductService {
};
}
// It is recommended to use the
// We recommend that you use the
// [ProductService.RemoveLocalInventories][google.cloud.retail.v2alpha.ProductService.RemoveLocalInventories]
// method instead of
// [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.RemoveFulfillmentPlaces].
// method instead of the
// [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.RemoveFulfillmentPlaces]
// method.
// [ProductService.RemoveLocalInventories][google.cloud.retail.v2alpha.ProductService.RemoveLocalInventories]
// achieves the same results but provides more fine-grained control over
// ingesting local inventory data.

View file

@ -0,0 +1,188 @@
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.cloud.retail.v2alpha;
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/cloud/retail/v2alpha/common.proto";
option csharp_namespace = "Google.Cloud.Retail.V2Alpha";
option go_package = "cloud.google.com/go/retail/apiv2alpha/retailpb;retailpb";
option java_multiple_files = true;
option java_outer_classname = "ProjectProto";
option java_package = "com.google.cloud.retail.v2alpha";
option objc_class_prefix = "RETAIL";
option php_namespace = "Google\\Cloud\\Retail\\V2alpha";
option ruby_package = "Google::Cloud::Retail::V2alpha";
// Project level logging config to control what level of log will be generated
// and written to Cloud Logging.
message LoggingConfig {
option (google.api.resource) = {
type: "retail.googleapis.com/LoggingConfig"
pattern: "projects/{project}/loggingConfig"
};
// The logging configurations for services supporting log generation.
message LogGenerationRule {
// The logging level.
//
// By default it is set to `LOG_WARNINGS_AND_ABOVE`.
LoggingLevel logging_level = 1;
// The log sample rate for INFO level log entries. You can use this to
// reduce the number of entries generated for INFO level logs.
//
// DO NOT set this field if the
// [logging_level][google.cloud.retail.v2alpha.LoggingConfig.LogGenerationRule.logging_level]
// is not
// [LoggingLevel.LOG_ALL][google.cloud.retail.v2alpha.LoggingConfig.LoggingLevel.LOG_ALL].
// Otherwise, an INVALID_ARGUMENT error is returned.
//
// Sample rate for INFO logs defaults to 1 when unset (generate and send all
// INFO logs to Cloud Logging). Its value must be greater than 0 and less
// than or equal to 1.
optional float info_log_sample_rate = 2;
}
// The granular logging configurations for supported services.
message ServiceLogGenerationRule {
// Required. Supported service names:
// "CatalogService",
// "CompletionService",
// "ControlService",
// "MerchantCenterStreaming",
// "ModelService",
// "PredictionService",
// "ProductService",
// "ServingConfigService",
// "UserEventService",
string service_name = 1 [(google.api.field_behavior) = REQUIRED];
// The log generation rule that applies to this service.
LogGenerationRule log_generation_rule = 3;
}
// The setting to control log generation.
enum LoggingLevel {
// Default value. Defaults to `LOG_FOR_WARNINGS_AND_ABOVE` if unset.
LOGGING_LEVEL_UNSPECIFIED = 0;
// No log will be generated and sent to Cloud Logging.
LOGGING_DISABLED = 1;
// Log for operations resulted in fatal error.
LOG_ERRORS_AND_ABOVE = 2;
// In addition to `LOG_ERRORS_AND_ABOVE`, also log for operations that have
// soft errors, quality suggestions.
LOG_WARNINGS_AND_ABOVE = 3;
// Log all operations, including successful ones.
LOG_ALL = 4;
}
// Required. Immutable. The name of the LoggingConfig singleton resource.
// Format: projects/*/loggingConfig
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.field_behavior) = IMMUTABLE
];
// The log generation rule that applies by default to all services
// supporting log generation. It can be overridden by
// [ServiceLogGenerationRule][google.cloud.retail.v2alpha.LoggingConfig.ServiceLogGenerationRule]
// for service level control.
LogGenerationRule default_log_generation_rule = 2;
// Controls logging configurations more granularly for each supported
// service.
//
// This overrides the
// [default_log_generation_rule][google.cloud.retail.v2alpha.LoggingConfig.default_log_generation_rule]
// for the services specified. For those not mentioned, they will fallback to
// the default log generation rule.
repeated ServiceLogGenerationRule service_log_generation_rules = 4;
}
// Metadata that describes a Cloud Retail Project.
message Project {
option (google.api.resource) = {
type: "retail.googleapis.com/RetailProject"
pattern: "projects/{project}/retailProject"
};
// Output only. Full resource name of the retail project, such as
// `projects/{project_id_or_number}/retailProject`.
string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. Retail API solutions that the project has enrolled.
repeated SolutionType enrolled_solutions = 2
[(google.api.field_behavior) = OUTPUT_ONLY];
}
// Project level alert config.
message AlertConfig {
option (google.api.resource) = {
type: "retail.googleapis.com/AlertConfig"
pattern: "projects/{project}/alertConfig"
};
// Alert policy for a customer.
message AlertPolicy {
// Recipient contact information.
message Recipient {
// Email address of the recipient.
string email_address = 1;
}
// The enrollment status enum for alert policy.
enum EnrollStatus {
// Default value. Used for customers who have not responded to the
// alert policy.
ENROLL_STATUS_UNSPECIFIED = 0;
// Customer is enrolled in this policy.
ENROLLED = 1;
// Customer declined this policy.
DECLINED = 2;
}
// The feature that provides alerting capability. Supported value is
// only `search-data-quality` for now.
string alert_group = 1;
// The enrollment status of a customer.
EnrollStatus enroll_status = 2;
// Recipients for the alert policy.
// One alert policy should not exceed 20 recipients.
repeated Recipient recipients = 3;
}
// Required. Immutable. The name of the AlertConfig singleton resource.
// Format: projects/*/alertConfig
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.field_behavior) = IMMUTABLE
];
// Alert policies for a customer.
// They must be unique by [AlertPolicy.alert_group]
repeated AlertPolicy alert_policies = 2;
}

View file

@ -0,0 +1,273 @@
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.cloud.retail.v2alpha;
import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/cloud/retail/v2alpha/common.proto";
import "google/cloud/retail/v2alpha/project.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/field_mask.proto";
option csharp_namespace = "Google.Cloud.Retail.V2Alpha";
option go_package = "cloud.google.com/go/retail/apiv2alpha/retailpb;retailpb";
option java_multiple_files = true;
option java_outer_classname = "ProjectServiceProto";
option java_package = "com.google.cloud.retail.v2alpha";
option objc_class_prefix = "RETAIL";
option php_namespace = "Google\\Cloud\\Retail\\V2alpha";
option ruby_package = "Google::Cloud::Retail::V2alpha";
// Service for settings at Project level.
service ProjectService {
option (google.api.default_host) = "retail.googleapis.com";
option (google.api.oauth_scopes) =
"https://www.googleapis.com/auth/cloud-platform";
// Gets the project.
//
// Throws `NOT_FOUND` if the project wasn't initialized for the Retail API
// service.
rpc GetProject(GetProjectRequest) returns (Project) {
option (google.api.http) = {
get: "/v2alpha/{name=projects/*/retailProject}"
};
option (google.api.method_signature) = "name";
}
// Accepts service terms for this project.
// By making requests to this API, you agree to the terms of service linked
// below.
// https://cloud.google.com/retail/data-use-terms
rpc AcceptTerms(AcceptTermsRequest) returns (Project) {
option (google.api.http) = {
post: "/v2alpha/{project=projects/*/retailProject}:acceptTerms"
body: "*"
};
option (google.api.method_signature) = "project";
}
// The method enrolls a solution of type [Retail
// Search][google.cloud.retail.v2alpha.SolutionType.SOLUTION_TYPE_SEARCH]
// into a project.
//
// The [Recommendations AI solution
// type][google.cloud.retail.v2alpha.SolutionType.SOLUTION_TYPE_RECOMMENDATION]
// is enrolled by default when your project enables Retail API, so you don't
// need to call the enrollSolution method for recommendations.
rpc EnrollSolution(EnrollSolutionRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v2alpha/{project=projects/*}:enrollSolution"
body: "*"
};
option (google.longrunning.operation_info) = {
response_type: "google.cloud.retail.v2alpha.EnrollSolutionResponse"
metadata_type: "google.cloud.retail.v2alpha.EnrollSolutionMetadata"
};
}
// Lists all the retail API solutions the project has enrolled.
rpc ListEnrolledSolutions(ListEnrolledSolutionsRequest)
returns (ListEnrolledSolutionsResponse) {
option (google.api.http) = {
get: "/v2alpha/{parent=projects/*}:enrolledSolutions"
};
option (google.api.method_signature) = "parent";
}
// Gets the [LoggingConfig][google.cloud.retail.v2alpha.LoggingConfig] of the
// requested project.
rpc GetLoggingConfig(GetLoggingConfigRequest) returns (LoggingConfig) {
option (google.api.http) = {
get: "/v2alpha/{name=projects/*/loggingConfig}"
};
option (google.api.method_signature) = "name";
}
// Updates the [LoggingConfig][google.cloud.retail.v2alpha.LoggingConfig] of
// the requested project.
rpc UpdateLoggingConfig(UpdateLoggingConfigRequest) returns (LoggingConfig) {
option (google.api.http) = {
patch: "/v2alpha/{logging_config.name=projects/*/loggingConfig}"
body: "logging_config"
};
option (google.api.method_signature) = "logging_config,update_mask";
}
// Get the [AlertConfig][google.cloud.retail.v2alpha.AlertConfig] of the
// requested project.
rpc GetAlertConfig(GetAlertConfigRequest) returns (AlertConfig) {
option (google.api.http) = {
get: "/v2alpha/{name=projects/*/alertConfig}"
};
option (google.api.method_signature) = "name";
}
// Update the alert config of the requested project.
rpc UpdateAlertConfig(UpdateAlertConfigRequest) returns (AlertConfig) {
option (google.api.http) = {
patch: "/v2alpha/{alert_config.name=projects/*/alertConfig}"
body: "alert_config"
};
option (google.api.method_signature) = "alert_config,update_mask";
}
}
// Request for GetProject method.
message GetProjectRequest {
// Required. Full resource name of the project. Format:
// `projects/{project_number_or_id}/retailProject`
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "retail.googleapis.com/RetailProject"
}
];
}
// Request for AcceptTerms method.
message AcceptTermsRequest {
// Required. Full resource name of the project. Format:
// `projects/{project_number_or_id}/retailProject`
string project = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "retail.googleapis.com/RetailProject"
}
];
}
// Request for EnrollSolution method.
message EnrollSolutionRequest {
// Required. Full resource name of parent. Format:
// `projects/{project_number_or_id}`
string project = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "cloudresourcemanager.googleapis.com/Project"
}
];
// Required. Solution to enroll.
SolutionType solution = 2 [(google.api.field_behavior) = REQUIRED];
}
// Response for EnrollSolution method.
message EnrollSolutionResponse {
// Retail API solution that the project has enrolled.
SolutionType enrolled_solution = 1;
}
// Metadata related to the EnrollSolution method.
// This will be returned by the google.longrunning.Operation.metadata field.
message EnrollSolutionMetadata {}
// Request for ListEnrolledSolutions method.
message ListEnrolledSolutionsRequest {
// Required. Full resource name of parent. Format:
// `projects/{project_number_or_id}`
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "cloudresourcemanager.googleapis.com/Project"
}
];
}
// Response for ListEnrolledSolutions method.
message ListEnrolledSolutionsResponse {
// Retail API solutions that the project has enrolled.
repeated SolutionType enrolled_solutions = 1;
}
// Request for
// [ProjectService.GetLoggingConfig][google.cloud.retail.v2alpha.ProjectService.GetLoggingConfig]
// method.
message GetLoggingConfigRequest {
// Required. Full LoggingConfig resource name. Format:
// projects/{project_number}/loggingConfig
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "retail.googleapis.com/LoggingConfig"
}
];
}
// Request for
// [ProjectService.UpdateLoggingConfig][google.cloud.retail.v2alpha.ProjectService.UpdateLoggingConfig]
// method.
message UpdateLoggingConfigRequest {
// Required. The [LoggingConfig][google.cloud.retail.v2alpha.LoggingConfig] to
// update.
//
// If the caller does not have permission to update the
// [LoggingConfig][google.cloud.retail.v2alpha.LoggingConfig], then a
// PERMISSION_DENIED error is returned.
//
// If the [LoggingConfig][google.cloud.retail.v2alpha.LoggingConfig] to update
// does not exist, a NOT_FOUND error is returned.
LoggingConfig logging_config = 1 [(google.api.field_behavior) = REQUIRED];
// Indicates which fields in the provided
// [LoggingConfig][google.cloud.retail.v2alpha.LoggingConfig] to update. The
// following are the only supported fields:
//
// * [LoggingConfig.default_log_generation_rule][google.cloud.retail.v2alpha.LoggingConfig.default_log_generation_rule]
// * [LoggingConfig.service_log_generation_rules][google.cloud.retail.v2alpha.LoggingConfig.service_log_generation_rules]
//
// If not set, all supported fields are updated.
google.protobuf.FieldMask update_mask = 2;
}
// Request for
// [ProjectService.GetAlertConfig][google.cloud.retail.v2alpha.ProjectService.GetAlertConfig]
// method.
message GetAlertConfigRequest {
// Required. Full AlertConfig resource name. Format:
// projects/{project_number}/alertConfig
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "retail.googleapis.com/AlertConfig"
}
];
}
// Request for
// [ProjectService.UpdateAlertConfig][google.cloud.retail.v2alpha.ProjectService.UpdateAlertConfig]
// method.
message UpdateAlertConfigRequest {
// Required. The [AlertConfig][google.cloud.retail.v2alpha.AlertConfig] to
// update.
//
// If the caller does not have permission to update the
// [AlertConfig][google.cloud.retail.v2alpha.AlertConfig], then a
// PERMISSION_DENIED error is returned.
//
// If the [AlertConfig][google.cloud.retail.v2alpha.AlertConfig] to update
// does not exist, a NOT_FOUND error is returned.
AlertConfig alert_config = 1 [(google.api.field_behavior) = REQUIRED];
// Indicates which fields in the provided
// [AlertConfig][google.cloud.retail.v2alpha.AlertConfig] to update. If not
// set, all supported fields are updated.
google.protobuf.FieldMask update_mask = 2;
}

View file

@ -34,7 +34,7 @@ message Promotion {
// id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is
// returned.
//
// Google Merchant Center property
// [promotion](https://support.google.com/merchants/answer/7050148).
// Corresponds to Google Merchant Center property
// [promotion_id](https://support.google.com/merchants/answer/7050148).
string promotion_id = 1;
}

View file

@ -4,10 +4,11 @@
"name": [
{ "service": "google.cloud.retail.v2alpha.CatalogService" },
{ "service": "google.cloud.retail.v2alpha.CompletionService" },
{ "service": "google.cloud.retail.v2alpha.UserEventService" },
{ "service": "google.cloud.retail.v2alpha.PromotionService" },
{ "service": "google.cloud.retail.v2alpha.PredictionService" },
{ "service": "google.cloud.retail.v2alpha.SearchService" }
{ "service": "google.cloud.retail.v2alpha.SearchService" },
{ "service": "google.cloud.retail.v2alpha.RequirementService" },
{ "service": "google.cloud.retail.v2alpha.SampleService" }
],
"timeout": "5s",
"retryPolicy": {
@ -19,7 +20,36 @@
},
{
"name": [
{ "service": "google.cloud.retail.v2alpha.UserEventService" }
],
"timeout": "10s",
"retryPolicy": {
"initialBackoff": "0.100s",
"maxBackoff": "5s",
"backoffMultiplier": 1.3,
"retryableStatusCodes": ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
}
},
{
"name": [
{
"service": "google.cloud.retail.v2alpha.PredictionService",
"method": "BatchPredict"
}
],
"timeout": "30s",
"retryPolicy": {
"initialBackoff": "0.100s",
"maxBackoff": "30s",
"backoffMultiplier": 1.3,
"retryableStatusCodes": ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
}
},
{
"name": [
{ "service": "google.cloud.retail.v2alpha.BranchService" },
{ "service": "google.cloud.retail.v2alpha.ProductService" },
{ "service": "google.cloud.retail.v2alpha.ProjectService" },
{
"service": "google.cloud.retail.v2alpha.UserEventService",
"method": "PurgeUserEvents"

View file

@ -1,11 +1,12 @@
type: google.api.Service
config_version: 3
name: retail.googleapis.com
title: Retail API
title: Vertex AI Search for Retail API
apis:
- name: google.cloud.location.Locations
- name: google.cloud.retail.v2alpha.AnalyticsService
- name: google.cloud.retail.v2alpha.BranchService
- name: google.cloud.retail.v2alpha.CatalogService
- name: google.cloud.retail.v2alpha.CompletionService
- name: google.cloud.retail.v2alpha.ControlService
@ -13,6 +14,7 @@ apis:
- name: google.cloud.retail.v2alpha.ModelService
- name: google.cloud.retail.v2alpha.PredictionService
- name: google.cloud.retail.v2alpha.ProductService
- name: google.cloud.retail.v2alpha.ProjectService
- name: google.cloud.retail.v2alpha.SearchService
- name: google.cloud.retail.v2alpha.ServingConfigService
- name: google.cloud.retail.v2alpha.UserEventService
@ -26,6 +28,8 @@ types:
- name: google.cloud.retail.v2alpha.AddLocalInventoriesResponse
- name: google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata
- name: google.cloud.retail.v2alpha.CreateModelMetadata
- name: google.cloud.retail.v2alpha.EnrollSolutionMetadata
- name: google.cloud.retail.v2alpha.EnrollSolutionResponse
- name: google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse
- name: google.cloud.retail.v2alpha.ExportErrorsConfig
- name: google.cloud.retail.v2alpha.ExportMetadata
@ -55,9 +59,10 @@ types:
documentation:
summary: |-
Cloud Retail service enables customers to build end-to-end personalized
recommendation systems without requiring a high level of expertise in
machine learning, recommendation system, or Google Cloud.
Vertex AI Search for Retail API is made up of Retail Search, Browse and
Recommendations. These discovery AI solutions help you implement
personalized search, browse and recommendations, based on machine learning
models, across your websites and mobile applications.
rules:
- selector: google.cloud.location.Locations.GetLocation
description: Gets information about a location.
@ -65,27 +70,6 @@ documentation:
- selector: google.cloud.location.Locations.ListLocations
description: Lists information about the supported locations for this service.
backend:
rules:
- selector: google.cloud.retail.v2alpha.CatalogService.UpdateCatalog
deadline: 10.0
- selector: google.cloud.retail.v2alpha.CompletionService.ImportCompletionData
deadline: 300.0
- selector: 'google.cloud.retail.v2alpha.ModelService.*'
deadline: 60.0
- selector: 'google.cloud.retail.v2alpha.ProductService.*'
deadline: 30.0
- selector: google.cloud.retail.v2alpha.ProductService.ImportProducts
deadline: 300.0
- selector: google.cloud.retail.v2alpha.UserEventService.CollectUserEvent
deadline: 10.0
- selector: google.cloud.retail.v2alpha.UserEventService.ImportUserEvents
deadline: 600.0
- selector: google.cloud.retail.v2alpha.UserEventService.PurgeUserEvents
deadline: 30.0
- selector: google.longrunning.Operations.ListOperations
deadline: 300.0
http:
rules:
- selector: google.longrunning.Operations.GetOperation
@ -115,6 +99,14 @@ authentication:
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform
- selector: google.cloud.retail.v2alpha.BranchService.GetBranch
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform
- selector: google.cloud.retail.v2alpha.BranchService.ListBranches
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform
- selector: 'google.cloud.retail.v2alpha.CatalogService.*'
oauth:
canonical_scopes: |-
@ -147,6 +139,10 @@ authentication:
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform
- selector: 'google.cloud.retail.v2alpha.ProjectService.*'
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform
- selector: google.cloud.retail.v2alpha.SearchService.Search
oauth:
canonical_scopes: |-

View file

@ -119,13 +119,13 @@ message SearchRequest {
// values. Maximum number of intervals is 40.
//
// For all numerical facet keys that appear in the list of products from
// the catalog, the percentiles 0, 10, 30, 50, 70, 90 and 100 are
// the catalog, the percentiles 0, 10, 30, 50, 70, 90, and 100 are
// computed from their distribution weekly. If the model assigns a high
// score to a numerical facet key and its intervals are not specified in
// the search request, these percentiles will become the bounds
// for its intervals and will be returned in the response. If the
// the search request, these percentiles become the bounds
// for its intervals and are returned in the response. If the
// facet key intervals are specified in the request, then the specified
// intervals will be returned instead.
// intervals are returned instead.
repeated Interval intervals = 2;
// Only get facet for the given restricted values. For example, when using
@ -158,14 +158,14 @@ message SearchRequest {
// Only get facet values that start with the given string prefix. For
// example, suppose "categories" has three values "Women > Shoe",
// "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the
// "categories" facet will give only "Women > Shoe" and "Women > Dress".
// "categories" facet gives only "Women > Shoe" and "Women > Dress".
// Only supported on textual fields. Maximum is 10.
repeated string prefixes = 8;
// Only get facet values that contains the given strings. For example,
// suppose "categories" has three values "Women > Shoe",
// "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the
// "categories" facet will give only "Women > Shoe" and "Men > Shoe".
// "categories" facet gives only "Women > Shoe" and "Men > Shoe".
// Only supported on textual fields. Maximum is 10.
repeated string contains = 9;
@ -198,7 +198,7 @@ message SearchRequest {
string order_by = 4;
// The query that is used to compute facet for the given facet key.
// When provided, it will override the default behavior of facet
// When provided, it overrides the default behavior of facet
// computation. The query syntax is the same as a filter expression. See
// [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]
// for detail syntax and limitations. Notice that there is no limitation
@ -208,9 +208,9 @@ message SearchRequest {
//
// In the response,
// [SearchResponse.Facet.values.value][google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.value]
// will be always "1" and
// is always "1" and
// [SearchResponse.Facet.values.count][google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.count]
// will be the number of results that match the query.
// is the number of results that match the query.
//
// For example, you can set a customized facet for "shipToStore",
// where
@ -218,7 +218,7 @@ message SearchRequest {
// is "customizedShipToStore", and
// [FacetKey.query][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.query]
// is "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")".
// Then the facet will count the products that are both in stock and ship
// Then the facet counts the products that are both in stock and ship
// to store "123".
string query = 5;
@ -269,15 +269,15 @@ message SearchRequest {
// Enables dynamic position for this facet. If set to true, the position of
// this facet among all facets in the response is determined by Google
// Retail Search. It will be ordered together with dynamic facets if dynamic
// Retail Search. It is ordered together with dynamic facets if dynamic
// facets is enabled. If set to false, the position of this facet in the
// response will be the same as in the request, and it will be ranked before
// response is the same as in the request, and it is ranked before
// the facets with dynamic position enable and all dynamic facets.
//
// For example, you may always want to have rating facet returned in
// the response, but it's not necessarily to always display the rating facet
// at the top. In that case, you can set enable_dynamic_position to true so
// that the position of rating facet in response will be determined by
// that the position of rating facet in response is determined by
// Google Retail Search.
//
// Another example, assuming you have the following facets in the request:
@ -288,13 +288,13 @@ message SearchRequest {
//
// * "brands", enable_dynamic_position = false
//
// And also you have a dynamic facets enable, which will generate a facet
// 'gender'. Then the final order of the facets in the response can be
// And also you have a dynamic facets enable, which generates a facet
// "gender". Then, the final order of the facets in the response can be
// ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
// "rating") depends on how Google Retail Search orders "gender" and
// "rating" facets. However, notice that "price" and "brands" will always be
// ranked at 1st and 2nd position since their enable_dynamic_position are
// false.
// "rating" facets. However, notice that "price" and "brands" are always
// ranked at first and second position because their enable_dynamic_position
// values are false.
bool enable_dynamic_position = 4;
}
@ -513,7 +513,7 @@ message SearchRequest {
// or the name of the legacy placement resource, such as
// `projects/*/locations/global/catalogs/default_catalog/placements/default_search`.
// This field is used to identify the serving config name and the set
// of models that will be used to make the search.
// of models that are used to make the search.
string placement = 1 [(google.api.field_behavior) = REQUIRED];
// The branch resource name, such as
@ -579,8 +579,8 @@ message SearchRequest {
// The filter syntax consists of an expression language for constructing a
// predicate from one or more fields of the products being filtered. Filter
// expression is case-sensitive. See more details at this [user
// guide](https://cloud.google.com/retail/docs/filter-and-order#filter).
// expression is case-sensitive. For more information, see
// [Filter](https://cloud.google.com/retail/docs/filter-and-order#filter).
//
// If this field is unrecognizable, an INVALID_ARGUMENT is returned.
string filter = 10;
@ -589,22 +589,21 @@ message SearchRequest {
// checking any filters on the search page.
//
// The filter applied to every search request when quality improvement such as
// query expansion is needed. For example, if a query does not have enough
// results, an expanded query with
// [SearchRequest.canonical_filter][google.cloud.retail.v2alpha.SearchRequest.canonical_filter]
// will be returned as a supplement of the original query. This field is
// strongly recommended to achieve high search quality.
// query expansion is needed. In the case a query does not have a sufficient
// amount of results this filter will be used to determine whether or not to
// enable the query expansion flow. The original filter will still be used for
// the query expanded search.
// This field is strongly recommended to achieve high search quality.
//
// See
// [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]
// for more details about filter syntax.
// For more information about filter syntax, see
// [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter].
string canonical_filter = 28;
// The order in which products are returned. Products can be ordered by
// a field in an [Product][google.cloud.retail.v2alpha.Product] object. Leave
// it unset if ordered by relevance. OrderBy expression is case-sensitive. See
// more details at this [user
// guide](https://cloud.google.com/retail/docs/filter-and-order#order).
// it unset if ordered by relevance. OrderBy expression is case-sensitive. For
// more information, see
// [Order](https://cloud.google.com/retail/docs/filter-and-order#order).
//
// If this field is unrecognizable, an INVALID_ARGUMENT is returned.
string order_by = 11;
@ -622,8 +621,8 @@ message SearchRequest {
// textual facets can be dynamically generated.
DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true];
// Boost specification to boost certain products. See more details at this
// [user guide](https://cloud.google.com/retail/docs/boosting).
// Boost specification to boost certain products. For more information, see
// [Boost results](https://cloud.google.com/retail/docs/boosting).
//
// Notice that if both
// [ServingConfig.boost_control_ids][google.cloud.retail.v2alpha.ServingConfig.boost_control_ids]
@ -635,8 +634,8 @@ message SearchRequest {
BoostSpec boost_spec = 13;
// The query expansion specification that specifies the conditions under which
// query expansion will occur. See more details at this [user
// guide](https://cloud.google.com/retail/docs/result-size#query_expansion).
// query expansion occurs. For more information, see [Query
// expansion](https://cloud.google.com/retail/docs/result-size#query_expansion).
QueryExpansionSpec query_expansion_spec = 14;
// The relevance threshold of the search results.
@ -644,8 +643,8 @@ message SearchRequest {
// Defaults to
// [RelevanceThreshold.HIGH][google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold.HIGH],
// which means only the most relevant results are shown, and the least number
// of results are returned. See more details at this [user
// guide](https://cloud.google.com/retail/docs/result-size#relevance_thresholding).
// of results are returned. For more information, see [Adjust result
// size](https://cloud.google.com/retail/docs/result-size#relevance_thresholding).
RelevanceThreshold relevance_threshold = 15;
// The keys to fetch and rollup the matching
@ -773,9 +772,9 @@ message SearchRequest {
// key with multiple resources.
// * Keys must start with a lowercase letter or international character.
//
// See [Google Cloud
// Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
// for more details.
// For more information, see [Requirements for
// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
// in the Resource Manager documentation.
map<string, string> labels = 34;
// The spell correction specification that specifies the mode under
@ -995,7 +994,8 @@ message SearchResponse {
repeated ExperimentInfo experiment_info = 17;
}
// Metadata for active A/B testing [Experiments][].
// Metadata for active A/B testing
// [Experiment][google.cloud.retail.v2alpha.Experiment].
message ExperimentInfo {
// Metadata for active serving config A/B tests.
message ServingConfigExperiment {
@ -1008,8 +1008,8 @@ message ExperimentInfo {
}];
// The fully qualified resource name of the serving config
// [VariantArm.serving_config_id][] responsible for generating the search
// response. For example:
// [Experiment.VariantArm.serving_config_id][google.cloud.retail.v2alpha.Experiment.VariantArm.serving_config_id]
// responsible for generating the search response. For example:
// `projects/*/locations/*/catalogs/*/servingConfigs/*`.
string experiment_serving_config = 2 [(google.api.resource_reference) = {
type: "retail.googleapis.com/ServingConfig"

View file

@ -255,6 +255,10 @@ message ServingConfig {
// [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
string enable_category_filter_level = 16;
// When the flag is enabled, the products in the denylist will not be filtered
// out in the recommendation filtering results.
bool ignore_recs_denylist = 24;
// The specification for personalization spec.
//
// Can only be set if

View file

@ -37,6 +37,7 @@ message UserEvent {
// Required. User event type. Allowed values are:
//
// * `add-to-cart`: Products being added to cart.
// * `remove-from-cart`: Products being removed from cart.
// * `category-page-view`: Special pages such as sale or promotion pages
// viewed.
// * `detail-page-view`: Products detail page viewed.
@ -274,8 +275,8 @@ message UserEvent {
// The entity for customers that may run multiple different entities, domains,
// sites or regions, for example, `Google US`, `Google Ads`, `Waymo`,
// `google.com`, `youtube.com`, etc.
// It is recommended to set this field to get better per-entity search,
// completion and prediction results.
// We recommend that you set this field to get better per-entity search,
// completion, and prediction results.
string entity = 23;
}