@@ -20,6 +20,7 @@ import "google/api/field_behavior.proto";
2020import "google/api/resource.proto" ;
2121import "google/cloud/retail/v2/common.proto" ;
2222import "google/cloud/retail/v2/import_config.proto" ;
23+ import "google/protobuf/timestamp.proto" ;
2324
2425option csharp_namespace = "Google.Cloud.Retail.V2" ;
2526option go_package = "cloud.google.com/go/retail/apiv2/retailpb;retailpb" ;
@@ -87,6 +88,123 @@ message ProductLevelConfig {
8788// Catalog level attribute config for an attribute. For example, if customers
8889// want to enable/disable facet for a specific attribute.
8990message CatalogAttribute {
91+ // Possible options for the facet that corresponds to the current attribute
92+ // config.
93+ message FacetConfig {
94+ // [Facet values][google.cloud.retail.v2.SearchResponse.Facet.values] to
95+ // ignore on [facets][google.cloud.retail.v2.SearchResponse.Facet] during
96+ // the specified time range for the given
97+ // [SearchResponse.Facet.key][google.cloud.retail.v2.SearchResponse.Facet.key]
98+ // attribute.
99+ message IgnoredFacetValues {
100+ // List of facet values to ignore for the following time range. The facet
101+ // values are the same as the attribute values. There is a limit of 10
102+ // values per instance of IgnoredFacetValues. Each value can have at most
103+ // 128 characters.
104+ repeated string values = 1 ;
105+
106+ // Time range for the current list of facet values to ignore.
107+ // If multiple time ranges are specified for an facet value for the
108+ // current attribute, consider all of them. If both are empty, ignore
109+ // always. If start time and end time are set, then start time
110+ // must be before end time.
111+ // If start time is not empty and end time is empty, then will ignore
112+ // these facet values after the start time.
113+ google.protobuf.Timestamp start_time = 2 ;
114+
115+ // If start time is empty and end time is not empty, then ignore these
116+ // facet values before end time.
117+ google.protobuf.Timestamp end_time = 3 ;
118+ }
119+
120+ // Replaces a set of textual facet values by the same (possibly different)
121+ // merged facet value. Each facet value should appear at most once as a
122+ // value per [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute].
123+ // This feature is available only for textual custom attributes.
124+ message MergedFacetValue {
125+ // All the facet values that are replaces by the same
126+ // [merged_value][google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue.merged_value]
127+ // that follows. The maximum number of values per MergedFacetValue is 25.
128+ // Each value can have up to 128 characters.
129+ repeated string values = 1 ;
130+
131+ // All the previous values are replaced by this merged facet value.
132+ // This merged_value must be non-empty and can have up to 128 characters.
133+ string merged_value = 2 ;
134+ }
135+
136+ // The current facet key (i.e. attribute config) maps into the
137+ // [merged_facet_key][google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet.merged_facet_key].
138+ // A facet key can have at most one child. The current facet key and the
139+ // merged facet key need both to be textual custom attributes or both
140+ // numerical custom attributes (same type).
141+ message MergedFacet {
142+ // The merged facet key should be a valid facet key that is different than
143+ // the facet key of the current catalog attribute. We refer this is
144+ // merged facet key as the child of the current catalog attribute. This
145+ // merged facet key can't be a parent of another facet key (i.e. no
146+ // directed path of length 2). This merged facet key needs to be either a
147+ // textual custom attribute or a numerical custom attribute.
148+ string merged_facet_key = 1 ;
149+ }
150+
151+ // Options to rerank based on facet values engaged by the user for the
152+ // current key. That key needs to be a custom textual key and facetable.
153+ // To use this control, you also need to pass all the facet keys engaged by
154+ // the user in the request using the field [SearchRequest.FacetSpec]. In
155+ // particular, if you don't pass the facet keys engaged that you want to
156+ // rerank on, this control won't be effective. Moreover, to obtain better
157+ // results, the facet values that you want to rerank on should be close to
158+ // English (ideally made of words, underscores, and spaces).
159+ message RerankConfig {
160+ // If set to true, then we also rerank the dynamic facets based on the
161+ // facet values engaged by the user for the current attribute key during
162+ // serving.
163+ bool rerank_facet = 1 ;
164+
165+ // If empty, rerank on all facet values for the current key. Otherwise,
166+ // will rerank on the facet values from this list only.
167+ repeated string facet_values = 2 ;
168+ }
169+
170+ // If you don't set the facet
171+ // [SearchRequest.FacetSpec.FacetKey.intervals][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.intervals]
172+ // in the request to a numerical attribute, then we use the computed
173+ // intervals with rounded bounds obtained from all its product numerical
174+ // attribute values. The computed intervals might not be ideal for some
175+ // attributes. Therefore, we give you the option to overwrite them with the
176+ // facet_intervals field. The maximum of facet intervals per
177+ // [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] is 40. Each
178+ // interval must have a lower bound or an upper bound. If both bounds are
179+ // provided, then the lower bound must be smaller or equal than the upper
180+ // bound.
181+ repeated Interval facet_intervals = 1 ;
182+
183+ // Each instance represents a list of attribute values to ignore as facet
184+ // values for a specific time range. The maximum number of instances per
185+ // [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] is 25.
186+ repeated IgnoredFacetValues ignored_facet_values = 2 ;
187+
188+ // Each instance replaces a list of facet values by a merged facet
189+ // value. If a facet value is not in any list, then it will stay the same.
190+ // To avoid conflicts, only paths of length 1 are accepted. In other words,
191+ // if "dark_blue" merged into "BLUE", then the latter can't merge into
192+ // "blues" because this would create a path of length 2. The maximum number
193+ // of instances of MergedFacetValue per
194+ // [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] is 100. This
195+ // feature is available only for textual custom attributes.
196+ repeated MergedFacetValue merged_facet_values = 3 ;
197+
198+ // Use this field only if you want to merge a facet key into another facet
199+ // key.
200+ MergedFacet merged_facet = 4 ;
201+
202+ // Set this field only if you want to rerank based on facet values engaged
203+ // by the user for the current key. This option is only possible for custom
204+ // facetable textual keys.
205+ RerankConfig rerank_config = 5 ;
206+ }
207+
90208 // The type of an attribute.
91209 enum AttributeType {
92210 // The type of the attribute is unknown.
@@ -210,7 +328,9 @@ message CatalogAttribute {
210328 // are indexed so that it can be filtered, faceted, or boosted in
211329 // [SearchService.Search][google.cloud.retail.v2.SearchService.Search].
212330 //
213- // Must be specified, otherwise throws INVALID_FORMAT error.
331+ // Must be specified when
332+ // [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level]
333+ // is CATALOG_LEVEL_ATTRIBUTE_CONFIG, otherwise throws INVALID_FORMAT error.
214334 IndexableOption indexable_option = 5 ;
215335
216336 // If DYNAMIC_FACETABLE_ENABLED, attribute values are available for dynamic
@@ -232,7 +352,9 @@ message CatalogAttribute {
232352 // [SearchService.Search][google.cloud.retail.v2.SearchService.Search], as
233353 // there are no text values associated to numerical attributes.
234354 //
235- // Must be specified, otherwise throws INVALID_FORMAT error.
355+ // Must be specified, when
356+ // [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level]
357+ // is CATALOG_LEVEL_ATTRIBUTE_CONFIG, otherwise throws INVALID_FORMAT error.
236358 SearchableOption searchable_option = 7 ;
237359
238360 // If EXACT_SEARCHABLE_ENABLED, attribute values will be exact searchable.
@@ -246,6 +368,9 @@ message CatalogAttribute {
246368 // results. If unset, the server behavior defaults to
247369 // [RETRIEVABLE_DISABLED][google.cloud.retail.v2.CatalogAttribute.RetrievableOption.RETRIEVABLE_DISABLED].
248370 RetrievableOption retrievable_option = 12 ;
371+
372+ // Contains facet options.
373+ FacetConfig facet_config = 13 ;
249374}
250375
251376// Catalog level attribute config.
@@ -335,8 +460,8 @@ message CompletionConfig {
335460 // Output only. Name of the LRO corresponding to the latest suggestion terms
336461 // list import.
337462 //
338- // Can use [GetOperation][google.longrunning.Operations.GetOperation] API to
339- // retrieve the latest state of the Long Running Operation.
463+ // Can use [GetOperation][google.longrunning.Operations.GetOperation] API
464+ // method to retrieve the latest state of the Long Running Operation.
340465 string last_suggestions_import_operation = 6
341466 [(google.api.field_behavior ) = OUTPUT_ONLY ];
342467
0 commit comments