semantic-kernel
semantic-kernel copied to clipboard
.Net: Fix milvus search metric type bug.
Motivation and Context
The metricType
parameter in the SearchAsync
method of the Milvus connector is incorrect.
It will always use the SimilarityMetricType.Ip
for searching.
Description
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
Contribution Checklist
- [X] The code builds clean without any errors or warnings
- [X] The PR follows the SK Contribution Guidelines and the pre-submission formatting script raises no violations
- [X] All unit tests pass, and I have added new tests where possible
- [X] I didn't break anyone :smile: