Initial Checks
Description
_execute_find_and_filter_query is used by two doc indices - in_memory and hnsw
The function sorts documents from lowest to highest based on the score before returning them
|
docs_sorted = sorted(docs_and_scores, key=lambda x: x[1]) |
This works for hnsw index, but for in_memory higher scores actually mean better matches. So as a result, we output bad matches first for in_memory index.
Example Code
No response
Python, Pydantic & OS Version
Affected Components
Initial Checks
Description
_execute_find_and_filter_queryis used by two doc indices - in_memory and hnswThe function sorts documents from lowest to highest based on the score before returning them
docarray/docarray/index/backends/helper.py
Line 60 in eedd83c
This works for hnsw index, but for in_memory higher scores actually mean better matches. So as a result, we output bad matches first for in_memory index.
Example Code
No response
Python, Pydantic & OS Version
Affected Components