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] ScoreFunction: variants are optional #752

Closed
lihuimingxs opened this issue Dec 4, 2023 · 1 comment · Fixed by #880
Closed

[BUG] ScoreFunction: variants are optional #752

lihuimingxs opened this issue Dec 4, 2023 · 1 comment · Fixed by #880
Labels
bug Something isn't working

Comments

@lihuimingxs
Copy link

lihuimingxs commented Dec 4, 2023

What is the bug?

ScoreFunction: variants are optional. But now, it is required.


public class FunctionScore implements TaggedUnion<FunctionScore.Kind, Object>, JsonpSerializable {
        ...
	private final Kind _kind;
	private final Object _value;
        ...
}

This issue may result in some query scenarios not being implemented on the client side, like this:


GET /_search
{
  "query": {
    "function_score": {
      "query": {
        "match_all": {}
      },
      "boost": "5",
      "functions": [
        {
          "filter": {
            "match": {
              "test": "cat"
            }
          },
          "weight": 42
        }
      ],
      "max_boost": 42,
      "score_mode": "max",
      "boost_mode": "multiply",
      "min_score": 42
    }
  }
}

How can one reproduce the bug?

Attempt to build FunctionScore without Kind using Java client.

What is the expected behavior?

ScoreFunction: variants are optional.

What is your host/environment?

macOS 11.6 (Apple M1)

OpenSearch 2.9.0

Do you have any screenshots?

If applicable, add screenshots to help explain your problem.

Do you have any additional context?

Add any other context about the problem.

@lihuimingxs lihuimingxs added bug Something isn't working untriaged labels Dec 4, 2023
@lihuimingxs
Copy link
Author

I will resolve it.

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
None yet
Development

Successfully merging a pull request may close this issue.

2 participants