-
Notifications
You must be signed in to change notification settings - Fork 58
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
how does filtering work in lantern #321
Comments
Filtering in Lantern can be done using standard SQL WHERE clauses. Here is a small example: CREATE TABLE small_world (id integer, vector real[3]);
INSERT INTO small_world (id, vector) VALUES (0, '{0,0,0}'), (1, '{0,0,1}');
-- Create an index on the vector column
CREATE INDEX ON small_world USING lantern_hnsw (vector);
-- Filter with a WHERE clause
SELECT id, vector FROM small_world WHERE id = 1; For more details, refer to the README.md file. References |
Hi @lukebuehler ! The example above does do filtering on |
Hi @lukebuehler, The filtering example from the pgvector docs you linked above will work with no changes for lantern indexes as well! If the filter filters out a large portion of the rows, vector searches with pgvector will often return no results. Let me know if you have any other questions! |
This is helpful thanks! Good to know that you are using a recursive post-filter in lantern. I missed the query example for filtering. In pgvector, if you have an index on the where column, the data is pre-filtered for exact search, and you can also create multiple partial indexes on a column which you can then select with a where clause. However, that only works with As for partial indexes, does lantern support it? It would be helpful for multi-tenanting. Just my 2c: I often look for filtering documentation for various vector dbs, and they are often not very clear. I think a doc page that explains the basics conditions when it pre-filters, post-filters, uses a partial index (or whatever your feature are), etc is really helpful. LanceDB has a decent page. |
Partial indexes are supported, exactly as in btree or pgvector indexes! Here is an example from our tests Thanks for the feedback on the docs! Will improve them before closing this issue. |
I'm evaluating lantern and would love to see a small example and documentation on how filtering works in lantern.
Could be simply something like this:
https://github.com/pgvector/pgvector/?tab=readme-ov-file#filtering
The text was updated successfully, but these errors were encountered: