@@ -95,9 +95,97 @@ message Control {
9595
9696 // Adjusts order of products in returned list.
9797 message BoostAction {
98- // Required. Strength of the boost, which should be in [-1, 1]. Negative
98+ // Specification for custom ranking based on customer specified attribute
99+ // value. It provides more controls for customized ranking than the simple
100+ // (condition, boost) combination above.
101+ message InterpolationBoostSpec {
102+ // The control points used to define the curve. The curve defined
103+ // through these control points can only be monotonically increasing
104+ // or decreasing(constant values are acceptable).
105+ message ControlPoint {
106+ // Optional. Can be one of:
107+ // 1. The numerical field value.
108+ // 2. The duration spec for freshness:
109+ // The value must be formatted as an XSD `dayTimeDuration` value (a
110+ // restricted subset of an ISO 8601 duration value). The pattern for
111+ // this is: `[nD][T[nH][nM][nS]]`.
112+ string attribute_value = 1 [(google.api.field_behavior ) = OPTIONAL ];
113+
114+ // Optional. The value between -1 to 1 by which to boost the score if
115+ // the attribute_value evaluates to the value specified above.
116+ float boost_amount = 2 [(google.api.field_behavior ) = OPTIONAL ];
117+ }
118+
119+ // The attribute(or function) for which the custom ranking is to be
120+ // applied.
121+ enum AttributeType {
122+ // Unspecified AttributeType.
123+ ATTRIBUTE_TYPE_UNSPECIFIED = 0 ;
124+
125+ // The value of the numerical field will be used to dynamically update
126+ // the boost amount. In this case, the attribute_value (the x value)
127+ // of the control point will be the actual value of the numerical
128+ // field for which the boost_amount is specified.
129+ NUMERICAL = 1 ;
130+
131+ // For the freshness use case the attribute value will be the duration
132+ // between the current time and the date in the datetime field
133+ // specified. The value must be formatted as an XSD `dayTimeDuration`
134+ // value (a restricted subset of an ISO 8601 duration value). The
135+ // pattern for this is: `[nD][T[nH][nM][nS]]`.
136+ // For example, `5D`, `3DT12H30M`, `T24H`.
137+ FRESHNESS = 2 ;
138+ }
139+
140+ // The interpolation type to be applied. Default will be linear
141+ // (Piecewise Linear).
142+ enum InterpolationType {
143+ // Interpolation type is unspecified. In this case, it defaults to
144+ // Linear.
145+ INTERPOLATION_TYPE_UNSPECIFIED = 0 ;
146+
147+ // Piecewise linear interpolation will be applied.
148+ LINEAR = 1 ;
149+ }
150+
151+ // Optional. The name of the field whose value will be used to determine
152+ // the boost amount.
153+ string field_name = 1 [(google.api.field_behavior ) = OPTIONAL ];
154+
155+ // Optional. The attribute type to be used to determine the boost amount.
156+ // The attribute value can be derived from the field value of the
157+ // specified field_name. In the case of numerical it is straightforward
158+ // i.e. attribute_value = numerical_field_value. In the case of freshness
159+ // however, attribute_value = (time.now() - datetime_field_value).
160+ AttributeType attribute_type = 2 [(google.api.field_behavior ) = OPTIONAL ];
161+
162+ // Optional. The interpolation type to be applied to connect the control
163+ // points listed below.
164+ InterpolationType interpolation_type = 3
165+ [(google.api.field_behavior ) = OPTIONAL ];
166+
167+ // Optional. The control points used to define the curve. The monotonic
168+ // function (defined through the interpolation_type above) passes through
169+ // the control points listed here.
170+ repeated ControlPoint control_points = 4
171+ [(google.api.field_behavior ) = OPTIONAL ];
172+ }
173+
174+ // Constant value boost or custom ranking based boost specifications.
175+ oneof boost_spec {
176+ // Optional. Strength of the boost, which should be in [-1, 1]. Negative
177+ // boost means demotion. Default is 0.0 (No-op).
178+ float fixed_boost = 4 [(google.api.field_behavior ) = OPTIONAL ];
179+
180+ // Optional. Complex specification for custom ranking based on customer
181+ // defined attribute value.
182+ InterpolationBoostSpec interpolation_boost_spec = 5
183+ [(google.api.field_behavior ) = OPTIONAL ];
184+ }
185+
186+ // Strength of the boost, which should be in [-1, 1]. Negative
99187 // boost means demotion. Default is 0.0 (No-op).
100- float boost = 1 [(google.api .field_behavior ) = REQUIRED ];
188+ float boost = 1 [deprecated = true ];
101189
102190 // Required. Specifies which products to apply the boost to.
103191 //
@@ -164,6 +252,24 @@ message Control {
164252 repeated string synonyms = 1 ;
165253 }
166254
255+ // Promote certain links based on some trigger queries.
256+ //
257+ // Example: Promote shoe store link when searching for `shoe` keyword.
258+ // The link can be outside of associated data store.
259+ message PromoteAction {
260+ // Required. Data store with which this promotion is attached to.
261+ string data_store = 1 [
262+ (google.api.field_behavior ) = REQUIRED ,
263+ (google.api.resource_reference ) = {
264+ type : "discoveryengine.googleapis.com/DataStore"
265+ }
266+ ];
267+
268+ // Required. Promotion attached to this action.
269+ SearchLinkPromotion search_link_promotion = 2
270+ [(google.api.field_behavior ) = REQUIRED ];
271+ }
272+
167273 // Actions are restricted by Vertical and Solution
168274 //
169275 // Required.
@@ -180,6 +286,11 @@ message Control {
180286
181287 // Treats a group of terms as synonyms of one another.
182288 SynonymsAction synonyms_action = 10 ;
289+
290+ // Promote certain links based on predefined trigger queries.
291+ //
292+ // This now only supports basic site search.
293+ PromoteAction promote_action = 15 ;
183294 }
184295
185296 // Immutable. Fully qualified name
0 commit comments