-
Notifications
You must be signed in to change notification settings - Fork 225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: find_and_filter for inmemory #1642
Conversation
Signed-off-by: jupyterjazz <saba.sturua@jina.ai>
docarray/index/backends/helper.py
Outdated
|
||
Args: | ||
doc_index: Document index instance. | ||
Either InMemoryExactNNIndex or HnswDocumentIndex. | ||
query: Dictionary containing search and filtering configuration. | ||
reverse_order: Flag indicating whether to sort in descending order. If set to | ||
False (default), the sorting will be in ascending order. | ||
|
||
Returns: | ||
Sorted documents and their corresponding scores. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not the right style for docstring
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got too used to langchain docstrings lol
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good.
Tho I have to say it is unclear why adding this reverse sorting fix the original problem. Can you add a comment somewhere in the code to explain it ?
FYI: docstring are not in the right format
Signed-off-by: jupyterjazz <saba.sturua@jina.ai>
📝 Docs are deployed on https://ft-fix-filter-and-find--jina-docs.netlify.app 🎉 |
#1640
Hybrid search (find+filter) for
InMemoryExactNNIndex
was prioritizing low similarities (lower scores) for returned matches. Fixed by adding an option to sort matches in a reverse order based on their scores.