Skip to content

MLE-19374 Updated cosine and annTopK functions #1779

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 1 commit into from
Jun 11, 2025

Conversation

rjrudin
Copy link
Contributor

@rjrudin rjrudin commented Jun 11, 2025

Based on changes to the server on 2025-06-06. cosine-similarity is now cosine and annTopK now accepts a map as its 5th argument.

@Copilot Copilot AI review requested due to automatic review settings June 11, 2025 17:11
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the vector functions to align with server changes as of 2025-06-06 by renaming cosineSimilarity to cosine and modifying annTopK to accept a map for options. Key changes include:

  • Renaming cosineSimilarity to cosine in tests, implementation, and documentation.
  • Updating annTopK’s API to accept a Map<String, Object> instead of a float tolerance.
  • Adjusting related documentation comments and test validations.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
marklogic-client-api/src/test/java/com/marklogic/client/test/rows/VectorTest.java Updated test cases for vector functions and annTopK API changes
marklogic-client-api/src/main/java/com/marklogic/client/impl/VecExprImpl.java Renamed cosineSimilarity to cosine and updated error messages accordingly
marklogic-client-api/src/main/java/com/marklogic/client/impl/PlanBuilderSubImpl.java Modified annTopK signature to accept a Map of options
marklogic-client-api/src/main/java/com/marklogic/client/expression/VecExpr.java Updated documentation to reflect the new cosine function
marklogic-client-api/src/main/java/com/marklogic/client/expression/PlanBuilder.java Updated annTopK documentation and method signature

Based on changes to the server on 2025-06-06. `cosine-similarity` is now `cosine` and `annTopK` now accepts a map as its 5th argument.
@rjrudin rjrudin force-pushed the feature/20906-vector-functions-fix branch from aca93d7 to e030819 Compare June 11, 2025 17:12
@rjrudin rjrudin changed the title MLE-20906 Updated cosine and annTopK functions MLE-19374 Updated cosine and annTopK functions Jun 11, 2025
Copy link
Contributor

@BillFarber BillFarber left a comment

Choose a reason for hiding this comment

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

Pending Jenkins success.

@rjrudin rjrudin merged commit 2ae3d85 into develop Jun 11, 2025
3 checks passed
@rjrudin rjrudin deleted the feature/20906-vector-functions-fix branch June 11, 2025 17:26
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.

2 participants