@@ -81,6 +81,42 @@ public class RecommendItemSegmentsToItemSegment extends Request {
8181 * If there is a custom AB-testing running, return the name of the group to which the request belongs.
8282 */
8383 protected Boolean returnAbGroup ;
84+ /**
85+ * A dictionary of [ReQL](https://docs.recombee.com/reql) expressions that will be executed for each recommended Item Segment.
86+ * This can be used to compute additional properties of the recommended Item Segments.
87+ * The keys are the names of the expressions, and the values are the actual ReQL expressions.
88+ * Example request:
89+ * ```json
90+ * {
91+ * "reqlExpressions": {
92+ * "countItems": "size(segment_items(\"categories\", 'segmentId'))"
93+ * }
94+ * }
95+ * ```
96+ * Example response:
97+ * ```json
98+ * {
99+ * "recommId": "a7ac55a4-8d6e-4f19-addc-abac4164d8a8",
100+ * "recomms":
101+ * [
102+ * {
103+ * "id": "category-fantasy-books",
104+ * "reqlEvaluations": {
105+ * "countItems": 486
106+ * }
107+ * },
108+ * {
109+ * "id": "category-sci-fi-costumes",
110+ * "reqlEvaluations": {
111+ * "countItems": 19
112+ * }
113+ * }
114+ * ],
115+ * "numberNextRecommsCalls": 0
116+ * }
117+ * ```
118+ */
119+ protected Map <String , String > reqlExpressions ;
84120
85121 /**
86122 * Construct the request
@@ -168,6 +204,46 @@ public RecommendItemSegmentsToItemSegment setReturnAbGroup(boolean returnAbGroup
168204 return this ;
169205 }
170206
207+ /**
208+ * @param reqlExpressions A dictionary of [ReQL](https://docs.recombee.com/reql) expressions that will be executed for each recommended Item Segment.
209+ * This can be used to compute additional properties of the recommended Item Segments.
210+ * The keys are the names of the expressions, and the values are the actual ReQL expressions.
211+ * Example request:
212+ * ```json
213+ * {
214+ * "reqlExpressions": {
215+ * "countItems": "size(segment_items(\"categories\", 'segmentId'))"
216+ * }
217+ * }
218+ * ```
219+ * Example response:
220+ * ```json
221+ * {
222+ * "recommId": "a7ac55a4-8d6e-4f19-addc-abac4164d8a8",
223+ * "recomms":
224+ * [
225+ * {
226+ * "id": "category-fantasy-books",
227+ * "reqlEvaluations": {
228+ * "countItems": 486
229+ * }
230+ * },
231+ * {
232+ * "id": "category-sci-fi-costumes",
233+ * "reqlEvaluations": {
234+ * "countItems": 19
235+ * }
236+ * }
237+ * ],
238+ * "numberNextRecommsCalls": 0
239+ * }
240+ * ```
241+ */
242+ public RecommendItemSegmentsToItemSegment setReqlExpressions (Map <String , String > reqlExpressions ) {
243+ this .reqlExpressions = reqlExpressions ;
244+ return this ;
245+ }
246+
171247 public String getContextSegmentId () {
172248 return this .contextSegmentId ;
173249 }
@@ -210,6 +286,10 @@ public boolean getReturnAbGroup() {
210286 return this .returnAbGroup ;
211287 }
212288
289+ public Map <String , String > getReqlExpressions () {
290+ return this .reqlExpressions ;
291+ }
292+
213293 /**
214294 * @return Used HTTP method
215295 */
@@ -267,6 +347,9 @@ public Map<String, Object> getBodyParameters() {
267347 if (this .returnAbGroup !=null ) {
268348 params .put ("returnAbGroup" , this .returnAbGroup );
269349 }
350+ if (this .reqlExpressions !=null ) {
351+ params .put ("reqlExpressions" , this .reqlExpressions );
352+ }
270353 return params ;
271354 }
272355
0 commit comments