-
Notifications
You must be signed in to change notification settings - Fork 23
Get by ids #25
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?
Get by ids #25
Conversation
|
||
result_docs = [] | ||
for key in ids: | ||
doc_dict = self.index.client.hgetall( |
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.
Should use a pipeline operation for this with transaciton=False
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.
@tylerhutcherson What do you think about these changes?
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.
See my comment for the differences between IDs and Keys. Thanks for contributing.
# Create a unique index name for testing | ||
index_name = f"test_index_{str(ULID())}" | ||
|
||
texts = ["foo", "bar", "baz"] |
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.
Here's where there is a conceptual misunderstanding... You have keys as keys = ["a", "b", "c"]
but those are not the keys; they are the IDs! Where you construct the ids
below, those are actually the Redis Keys.
What this PR should do is pass ids and internally grab the prefix from the index to construct the keys that will be retrieved from Redis. cc @tylerhutcherson
I have implemented the get_by_ids method in the VectorStore class, along with its unit and integration tests. @bsbodden @efriis @tylerhutcherson @baskaryan @ccurme