Skip to content

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

Merged
bevzzz merged 3 commits into
mainfrom
feat/minimum_should_match
Jun 16, 2025
Merged

feat: add searchOperator (minimum_should_match) to bm25 and hybrid arguments#386
bevzzz merged 3 commits into
mainfrom
feat/minimum_should_match

Conversation

@bevzzz
Copy link
Copy Markdown
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
Copy Markdown

@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

Comment thread src/main/java/io/weaviate/client/v1/graphql/query/argument/Bm25Argument.java Outdated
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