Skip to content

Are the results returned by hybrid search guaranteed to be in order from most to least relevant? #41364

Discussion options

You must be logged in to vote

Search results are always ordered from most to least relevant, both for search() and hybrid_search().
In a search result set, you will see an id-distance or id-score pair for each item. No matter whether we call it "distance" or "score", it is a number output from a mathematical algorithm. The mathematical algorithm calculates the similarity/distance of two embeddings.
All the mathematical algorithms are listed here: https://milvus.io/docs/metric.md

  • L2 - Euclidean distance
    The distance range is [0, ∞), 0 is the most relevant, ∞ is the least relevant. So, if you choose L2 metric type, the search result is ordered by distance in ascending order.

  • IP - Inner product
    The similarity range i…

Replies: 1 comment 2 replies

Comment options

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

@yhmo
Comment options

yhmo Apr 17, 2025
Collaborator

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