How to change similarity calculation methods

I want to use different similarity calculation methods like cosine, dot product, etc…
So, I checked with the below

q = {
    "q": {  
        "customVector": {"vector": qu.tolist()}  
    },
    "ann_parameters": {  
        "similarity": "cosine",  
        "ef_search": 512 
    }
}

but, it is not working

Hello @Dhamu785 , thanks for raising this question. The annParameters is set when you create an Marqo index. This is because the distance metrics is also needed when building the NSNW index. See this doc for details. And at search time, you can only set ef_search parameter (this is the size of the dynamic list for the nearest neighbors).

Could you please elaborate your use case a bit so we can help you find an optimal solution? Thanks.

1 Like