Database / Milvus Vector database Interview questions
What are the similarity/distance metrics Milvus supports?
The metric type determines how "closeness" between two vectors is mathematically defined, and it has to match how the embedding model that produced the vectors was actually trained to be meaningful.
| Metric | Typical use |
| L2 (Euclidean distance) | Straight-line distance between vectors; common for many general embedding models. |
| IP (Inner Product) | Used when vector magnitude carries meaning, common with certain recommendation embeddings. |
| COSINE | Measures the angle between vectors, ignoring magnitude; common for text embeddings. |
| HAMMING / JACCARD | Used specifically for binary vectors, measuring bit-level or set differences. |
Choosing the wrong metric for a given embedding model, one it wasn't trained or normalized for, doesn't necessarily cause an error, but it silently produces worse, less meaningful search results, since the notion of "similar" the metric computes no longer lines up with what the model actually learned to encode.
More Related questions...