Skip to content

feat: add searchOperator (minimum_should_match) to bm25 and hybrid arguments #386

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

Merged
merged 3 commits into from
Jun 16, 2025

Conversation

bevzzz
Copy link
Collaborator

@bevzzz bevzzz commented Jun 3, 2025

This PR adds searchOperator and bm25SearchOperator builder methods to Bm25Argument and HybridArgument builders respectively.

Bm25Argument.builder()
  .query("who's this new operator on the block?")
  .searchOperator(Bm25Argument.SearchOperator.and())
  .build()

HybridArgument.builder()
  .query("but can it OR?")
  .bm25SearchOperator(Bm25Argument.SearchOperator.or(/* minimumMatch: */ 4))
  .build()

Tested via unit tests.

Copy link

@orca-security-eu orca-security-eu bot left a comment

Choose a reason for hiding this comment

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

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Infrastructure as Code high 0   medium 0   low 0   info 0 View in Orca
Passed Passed SAST high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Vulnerabilities high 0   medium 0   low 0   info 0 View in Orca

bevzzz added 2 commits June 16, 2025 13:50
GraphQL validation on the server makes this a required parameter
even though it's ignored for operator=And
@bevzzz bevzzz merged commit de85c6b into main Jun 16, 2025
5 checks passed
@bevzzz bevzzz deleted the feat/minimum_should_match branch June 16, 2025 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants