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

[BUG] Weight attribute of personalized intelligent ranking processor is not validated at the time of pipeline creation #148

Open
kartg opened this issue Jun 14, 2023 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@kartg
Copy link
Member

kartg commented Jun 14, 2023

What is the bug?
We allow creation of a search pipeline that uses the personalized intelligent ranking search processor with a weight attribute outside the 0 to 1 bounds. While the pipeline creation succeeds, the search pipeline will eventually throw an IllegalArgumentException since the bounds check occurs when responses are processed by the pipeline.

How can one reproduce the bug?
Request:

PUT /_search/pipeline/intelligent_ranking HTTP/1.1
Host: localhost:9200
Authorization: Basic YWRtaW46YWRtaW4=
User-Agent: curl/7.81.0
Accept: */*
Content-Type: application/json
Content-Length: 464
Connection: close


{
  "description": "A pipeline to apply custom reranking",
  "response_processors" : [
    {
      "personalize_ranking" : {
        "campaign_arn" : "[redacted]",
        "item_id_field" : "",
        "recipe" : "aws-personalized-ranking",
        "weight" : "20.25",
        "iam_role_arn": "[redacted]",
        "aws_region": "us-west-2"
      }
    }
  ]
}

Response:

HTTP/1.1 200 OK
content-type: application/json; charset=UTF-8
content-length: 21

{"acknowledged":true}

What is the expected behavior?
Validation failure / HTTP 4xx error

Do you have any screenshots?
N/A

Do you have any additional context?
N/A

@kartg
Copy link
Member Author

kartg commented Jun 14, 2023

Also note that no deep validation is performed on the campaign_arn and iam_role_arn String values

@sejli sejli removed the untriaged label Jun 19, 2023
@sejli
Copy link
Member

sejli commented Jun 19, 2023

@kulket Are you going to take this issue? If so, could you please assign yourself to it? Thanks!

@msfroh
Copy link
Collaborator

msfroh commented Sep 18, 2023

@kulket, @mishprs -- can one of you take this one? Just comment on this issue and we can assign it to one of you. (We can't assign it until you participate in the issue.)

@harshavamsi
Copy link

@msfroh I can pick this one up

@harshavamsi harshavamsi self-assigned this Sep 20, 2023
@kulket
Copy link
Contributor

kulket commented Sep 20, 2023

I believe this is already addressed by validation here which is performed as part of create response processor here.

Unit test for the above validation is here.

I remember this validation was performed in different code path earlier but we changed it. So I think we can close this as fixed. Let me know if you agree.

@getsaurabh02 getsaurabh02 moved this from 🆕 New to Later (6 months plus) in Search Project Board Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Later (6 months plus)
Development

No branches or pull requests

5 participants