Skip to content
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

BaseVectorStorage-Add-Search-Function #2058

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

subway-jack
Copy link
Collaborator

Description

Describe your changes in detail (optional if the linked issue already contains a detailed description of the changes).

Checklist

Go over all the following points, and put an x in all the boxes that apply.

  • I have read the CONTRIBUTION guide (required)
  • I have linked this PR to an issue using the Development section on the right sidebar or by adding Fixes #issue-number in the PR description (required)
  • I have checked if any dependencies need to be added or updated in pyproject.toml and uv lock
  • I have updated the tests accordingly (required for a bug fix or a new feature)
  • I have updated the documentation if needed:
  • I have added examples if this is a new feature

If you are unsure about any of these, don't hesitate to ask. We are here to help!

@subway-jack subway-jack self-assigned this Mar 31, 2025
@subway-jack subway-jack changed the title Base vector storage add search BaseVectorStorage-Add-Search-Function Mar 31, 2025
Copy link
Collaborator

@zjrwtx zjrwtx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @subway-jack !left some comments

)

schema.add_field(
field_name="id",
datatype=DataType.VARCHAR,
descrition='A unique identifier for the vector',
descrition="A unique identifier for the vector",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
descrition="A unique identifier for the vector",
description="A unique identifier for the vector",

@zjrwtx
Copy link
Collaborator

zjrwtx commented Mar 31, 2025

please run pre-commit before commit

id: str,
payload: Dict[str, Any],
) -> "VectorDBSearchResult":
r"""A class method to construct a `VectorDBSearchResult` instance."""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docstring may need may clear

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I'll add more details

id: str,
payload: Dict[str, Any],
) -> "VectorDBSearchResult":
r"""A class method to construct a `VectorDBSearchResult` instance."""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docstring may need more clear

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I'll add more details

@lightaime
Copy link
Member

lightaime commented Mar 31, 2025

Thanks @subway-jack for the contributions!

@AveryYay Hi Avery. It would be great if you can help with reviewing this PR.

add the more description detail
add the more description detail
add the more description detail
add the more description detail
@AveryYay
Copy link
Collaborator

Thanks @subway-jack for the contributions!

@AveryYay Hi Avery. It would be great if you can help with reviewing this PR.

Sure!

if isinstance(cond, dict):
expressions = []
for op, v in cond.items():
if op == "$eq":
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would consider using a dictionary to do the if-else matching here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] Add search to BaseVectorStorage and all classes implemented it
4 participants