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

[new feature] filter metadata on field date/datatime #18

Open
SebG-js opened this issue Nov 19, 2024 · 3 comments
Open

[new feature] filter metadata on field date/datatime #18

SebG-js opened this issue Nov 19, 2024 · 3 comments

Comments

@SebG-js
Copy link

SebG-js commented Nov 19, 2024

Hello,

When I put data in the db, I store embeddings and metadata like filename, ext, size and modification date.
In some cases, I want old files or new files close to a query embedding.

When I search documents with python sdk, I use embeddings and some other criteria like the modification date.

Today the filter support only meta_contains.
It could be nice to support comparison like meta["date"] <= ... or meta["date"]> ...

For now, I use this workaround :
generate a big meta_contains dict

@VoVAllen
Copy link
Member

Are you using SQLAlchemy or Psycopg3?

@SebG-js
Copy link
Author

SebG-js commented Nov 19, 2024

I use Psycopg3 :

from pgvecto_rs.sdk import PGVectoRs, Record
from uuid import UUID

# doc: https://github.com/tensorchord/pgvecto.rs-py/blob/main/src/pgvecto_rs/sdk/client.py
class Client:

    def __init__(self, config: dict, table: str):
        url = f'postgresql+psycopg://{config["username"]}:{config["password"]}@{config["host"]}:{config["port"]}/{config["database"]}'
        self.client = PGVectoRs(
            db_url=url,
            collection_name=table,
            dimension=1024,
            recreate=False
        )

@SebG-js SebG-js changed the title filter metadata on field date/datatime [new feature] filter metadata on field date/datatime Nov 19, 2024
@VoVAllen
Copy link
Member

It's hard to support all kinds of filter. If you prefer such interface, SQLAlchemy might be a better choice which has full support of such primitives

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

No branches or pull requests

2 participants