You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The metricType parameter in the SearchAsync 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 as SimilarityMetricType.Cosine when creating the MilvusMemoryStore, SimilarityMetricType.IP is still used during the search.
### 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]>
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: