|
13 | 13 | /**
|
14 | 14 | * Recommends set of items that are somehow related to one given item, *X*. Typical scenario is when user *A* is viewing *X*. Then you may display items to the user that he might be also interested in. Recommend items to item request gives you Top-N such items, optionally taking the target user *A* into account.
|
15 | 15 | * It is also possible to use POST HTTP method (for example in case of very long ReQL filter) - query parameters then become body parameters.
|
| 16 | + * The returned items are sorted by relevancy (first item being the most relevant). |
16 | 17 | */
|
17 | 18 | public class RecommendItemsToItem extends Request {
|
18 | 19 |
|
@@ -138,6 +139,10 @@ public class RecommendItemsToItem extends Request {
|
138 | 139 | * Dictionary of custom options.
|
139 | 140 | */
|
140 | 141 | protected Map<String, Object> expertSettings;
|
| 142 | + /** |
| 143 | + * If there is a custom AB-testing running, return name of group to which the request belongs. |
| 144 | + */ |
| 145 | + protected Boolean returnAbGroup; |
141 | 146 |
|
142 | 147 | /**
|
143 | 148 | * Construct the request
|
@@ -310,6 +315,14 @@ public RecommendItemsToItem setExpertSettings(Map<String, Object> expertSettings
|
310 | 315 | return this;
|
311 | 316 | }
|
312 | 317 |
|
| 318 | + /** |
| 319 | + * @param returnAbGroup If there is a custom AB-testing running, return name of group to which the request belongs. |
| 320 | + */ |
| 321 | + public RecommendItemsToItem setReturnAbGroup(boolean returnAbGroup) { |
| 322 | + this.returnAbGroup = returnAbGroup; |
| 323 | + return this; |
| 324 | + } |
| 325 | + |
313 | 326 | public String getItemId() {
|
314 | 327 | return this.itemId;
|
315 | 328 | }
|
@@ -372,6 +385,11 @@ public Map<String, Object> getExpertSettings() {
|
372 | 385 | return this.expertSettings;
|
373 | 386 | }
|
374 | 387 |
|
| 388 | + public boolean getReturnAbGroup() { |
| 389 | + if (this.returnAbGroup==null) return false; |
| 390 | + return this.returnAbGroup; |
| 391 | + } |
| 392 | + |
375 | 393 | /**
|
376 | 394 | * @return Used HTTP method
|
377 | 395 | */
|
@@ -443,6 +461,9 @@ public Map<String, Object> getBodyParameters() {
|
443 | 461 | if (this.expertSettings!=null) {
|
444 | 462 | params.put("expertSettings", this.expertSettings);
|
445 | 463 | }
|
| 464 | + if (this.returnAbGroup!=null) { |
| 465 | + params.put("returnAbGroup", this.returnAbGroup); |
| 466 | + } |
446 | 467 | return params;
|
447 | 468 | }
|
448 | 469 |
|
|
0 commit comments