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 rank threshold #582

Merged
merged 11 commits into from
Nov 27, 2024
Merged

Conversation

danFbach
Copy link
Contributor

Pull Request

Related issue

Fixes #544

What does this PR do?

  • adds support for utilizing RankingScoreThreshold SearchQuery parameter.

PR checklist

Please check if your PR fulfills the following requirements:

  • Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)?
  • Have you read the contributing guidelines?
  • Have you made sure that the title is accurate and descriptive of the changes?

@danFbach
Copy link
Contributor Author

Is it necessary to enforce the threshold range of 0.0 - 1.0 locally, or can we just allow meilisearch to ignore/reject when the value falls outside that range?

@curquiza curquiza self-requested a review November 14, 2024 15:55
@curquiza curquiza added the enhancement New feature or request label Nov 27, 2024
search_parameter_reference_ranking_score_threshold_1: |-
var params = new SearchQuery()
{
RankingScoreThreshold = 0.2M
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

c# requires M when setting a decimal value. 0.2 is interpreted as a double and 0.2M is a decimal.
ex:
image

{
RankingScoreThreshold = 0.2M
};
await client.Index("INDEX_NAME").SearchAsync<T>("badman", params);
Copy link
Member

Choose a reason for hiding this comment

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

Can you remove the "no new line" at the end of the line?

Copy link
Member

Choose a reason for hiding this comment

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

we follow the editorconfig rules

@curquiza curquiza changed the title Add rank threshold 544 Add rank threshold Nov 27, 2024
@curquiza
Copy link
Member

@danFbach

Looks like there is an issue with the lining (cf CI)

Can you fix this test?

Copy link
Member

@curquiza curquiza left a comment

Choose a reason for hiding this comment

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

Awesome!

thank you

bors merge

Copy link
Contributor

meili-bors bot commented Nov 27, 2024

Build succeeded:

@meili-bors meili-bors bot merged commit bd65e68 into meilisearch:main Nov 27, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[v1.9] Support rankingScoreThreshold search parameter
2 participants