-
Notifications
You must be signed in to change notification settings - Fork 2
feat(indexers): added partial matching to reverse search #131
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
base: main
Are you sure you want to change the base?
Conversation
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.
Behaves as described, and implemented well. Happy to approve.
Tested based on DEMO notebook;
Couple of small points:
- could you update the documentation (README, Demo general_workflow notebook, reverse_search docstring) to mention this functionality so it's visible to users?
- currently the dataframe we return is sorted by
doc_id- I think it would be more intuitive if it was returned sorted first byid, then bydoc_id. Do you agree? If not, happy to approve this now and talk later, and if so up to you whether you think it would be good to add to this PR or list as a separate task for a later date.
I think your join is great, I was thinking more of a possible final sorting step on the |
I see what you mean, will put it in as default and can can set as optional later ideas change |
frayle-ons
left a comment
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.
Looks good to me, like the code and agree that it should be sorted by 'id' first and the sub-sorted by 'doc_id'
only suggestion is that we add a boolean parameter to the method to switch between exact matching and partial matching
|
|
||
| return results_df | ||
|
|
||
| def reverse_search(self, query: VectorStoreReverseSearchInput, n_results=100) -> VectorStoreReverseSearchOutput: |
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 think it would be appropriate to add a new method parameter 'do_partial' (or other name) and have it default to false?
so by default only full id matching results are returned, but if true then this partial matching code activates?

✨ Summary
Resolves #130
Adds partial "starts_with" matching to the reverse searches to check for hierarchical queries
📜 Changes Introduced
✅ Checklist
terraform fmt&terraform validate)🔍 How to Test
Attempt using in both api and reverse search demos, should preserve order and do hierarchical matching on demo codes