Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add personalized ranking v2 recipe to personalize intelligent ranking… #228

Merged

Conversation

ivan-tse
Copy link
Contributor

@ivan-tse ivan-tse commented Jun 5, 2024

Description

Adds PersonalizedRankingV2 recipe to personalize intelligent ranking plugin. Example of change when creating pipeline with the new recipe:
curl -X PUT "http://localhost:9200/_search/pipeline/intelligent_ranking" -u 'admin:admin' --insecure -H 'Content-Type: application/json' -d'
{
"description": "A pipeline to apply custom reranking",
"response_processors" : [
{
"personalized_search_ranking" : {
"campaign_arn" : "arn:aws:personalize:us-east-1:080258283992:campaign/opensearch-campaign",
"item_id_field" : "",
"recipe" : "aws-personalized-ranking-v2",
"weight" : "0.25",
"iam_role_arn": "",
"aws_region": "us-east-1"
}
}
]
}'

Testing

./gradlew build and tested locally by running above command

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed as per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

… plugin

Signed-off-by: Ivan Tse <tseiva@amazon.com>
Comment on lines +34 to +35
if (recipeInConfig.equals(AMAZON_PERSONALIZED_RANKING_RECIPE_NAME)
|| recipeInConfig.equals(AMAZON_PERSONALIZED_RANKING_V2_RECIPE_NAME)) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: We can move this to a constant array.

@ivan-tse ivan-tse marked this pull request as ready for review June 7, 2024 16:51
@noCharger noCharger merged commit 603f265 into opensearch-project:main Jun 21, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants