Skip to content

about query result distances #26290

Aug 11, 2023 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

It depends on the metric type: https://milvus.io/docs/metric.md

When you creating an index by create_index() ,there is parameter "metric_type":

    index_param = {
        "index_type": "IVF_FLAT",
        "params": {"nlist": 1024},
        "metric_type": "L2"}
    collection.create_index(filed_name, index_param)

The search() interface also has a parameter "metric_type",

search_param = {
        "data": search_vectors,
        "anns_field": vector_field,
        "param": {"metric_type": "L2", "params": {"nprobe": 10}},
        "limit": 10}
    results = collection.search(**search_param)

We require the "metric_type" must be the same for create_index() and search().
L2 is Euclidean distan…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@echalabiyev
Comment options

@yhmo
Comment options

yhmo May 30, 2025
Collaborator

Answer selected by gaoyuan98
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants