-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
.Net: Bug: The Milvus connector search metric type is incorrect #7062
Comments
markwallace-microsoft
added
.NET
Issue or Pull requests regarding .NET code
triage
labels
Jul 2, 2024
4 tasks
github-merge-queue bot
pushed a commit
that referenced
this issue
Jul 3, 2024
### Motivation and Context <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> The `metricType` parameter in the `SearchAsync` method of the Milvus connector is incorrect. It will always use the `SimilarityMetricType.Ip` for searching. ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> The current code hard-codes the milvus search metric type to `SimilarityMetricType.Ip`, which causes the issue where even if the Metric type is specified as `SimilarityMetricType.Cosine` when creating the `MilvusMemoryStore`, `SimilarityMetricType.IP` is still used during the search. Issue: [#7062](#7062) ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [X] The code builds clean without any errors or warnings - [X] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [X] All unit tests pass, and I have added new tests where possible - [X] I didn't break anyone 😄 --------- Co-authored-by: Roger Barreto <[email protected]>
LudoCorporateShark
pushed a commit
to LudoCorporateShark/semantic-kernel
that referenced
this issue
Aug 25, 2024
### Motivation and Context <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> The `metricType` parameter in the `SearchAsync` method of the Milvus connector is incorrect. It will always use the `SimilarityMetricType.Ip` for searching. ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> The current code hard-codes the milvus search metric type to `SimilarityMetricType.Ip`, which causes the issue where even if the Metric type is specified as `SimilarityMetricType.Cosine` when creating the `MilvusMemoryStore`, `SimilarityMetricType.IP` is still used during the search. Issue: [microsoft#7062](microsoft#7062) ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [X] The code builds clean without any errors or warnings - [X] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [X] All unit tests pass, and I have added new tests where possible - [X] I didn't break anyone 😄 --------- Co-authored-by: Roger Barreto <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
The
metricType
parameter in theSearchAsync
method of the Milvus connector is incorrect.The current code hard-codes the milvus search metric type to
SimilarityMetricType.Ip
, which causes the issue where even if the Metric type is specified asSimilarityMetricType.Cosine
when creating theMilvusMemoryStore
,SimilarityMetricType.IP
is still used during the search.To Reproduce
The source code:
semantic-kernel/dotnet/src/Connectors/Connectors.Memory.Milvus
/MilvusMemoryStore.cs#L449
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
Platform
/MilvusMemoryStore.cs#L449
The text was updated successfully, but these errors were encountered: