Skip to content

Instantly share code, notes, and snippets.

@jimarnold
Created June 2, 2023 13:31
Show Gist options
  • Save jimarnold/0f400cfba1e170b0f2e6c4f19ffdedd1 to your computer and use it in GitHub Desktop.
Save jimarnold/0f400cfba1e170b0f2e6c4f19ffdedd1 to your computer and use it in GitHub Desktop.
diff --git a/phplib/Recsys/ReactorRecs/Infra/Provider/MMXv2/Dynamic/RecSetParams.php b/phplib/Recsys/ReactorRecs/Infra/Provider/MMXv2/Dynamic/RecSetParams.php
index 2487587c4b2a..0c4080f44d03 100644
--- a/phplib/Recsys/ReactorRecs/Infra/Provider/MMXv2/Dynamic/RecSetParams.php
+++ b/phplib/Recsys/ReactorRecs/Infra/Provider/MMXv2/Dynamic/RecSetParams.php
@@ -21,4 +21,8 @@ public function build(): array {
}
return $result;
}
+
+ public function getFeatureLoggingParams(): array {
+ return $this->ranker->getFeatureLoggingParams();
+ }
}
diff --git a/phplib/Recsys/ReactorRecs/Infra/Registry/Dynamic/Ranker.php b/phplib/Recsys/ReactorRecs/Infra/Registry/Dynamic/Ranker.php
index 3740defd6fb3..a50da1b024b3 100644
--- a/phplib/Recsys/ReactorRecs/Infra/Registry/Dynamic/Ranker.php
+++ b/phplib/Recsys/ReactorRecs/Infra/Registry/Dynamic/Ranker.php
@@ -14,4 +14,8 @@ public function build(): array {
"context" => $this->context->build(),
];
}
+
+ public function getFeatureLoggingParams(): array {
+ return $this->context->getFeatureLoggingParams();
+ }
}
diff --git a/phplib/Recsys/ReactorRecs/Infra/Registry/Dynamic/RankerContext.php b/phplib/Recsys/ReactorRecs/Infra/Registry/Dynamic/RankerContext.php
index da30d1aa4a9f..fb12cc738292 100644
--- a/phplib/Recsys/ReactorRecs/Infra/Registry/Dynamic/RankerContext.php
+++ b/phplib/Recsys/ReactorRecs/Infra/Registry/Dynamic/RankerContext.php
@@ -12,4 +12,12 @@ public function build(): array {
"args" => $this->args,
];
}
+
+ public function getFeatureLoggingParams(): array {
+ $result = [];
+ if (key_exists('listingId', $this->args)) {
+ $result['listingIds'] = [$this->args['listingId']];
+ }
+ return $result;
+ }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment