Skip to content

.Net: Bug: The Milvus connector search metric type is incorrect #7062

@shuaihuadu

Description

@shuaihuadu

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.

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

image

Platform

Metadata

Metadata

Assignees

No one assigned

    Labels

    .NETIssue or Pull requests regarding .NET codebugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions