asg017 / sqlite-vec

A vector search SQLite extension that runs anywhere!
Apache License 2.0
4.26k stars 135 forks source link

Throw exception while using JOIN query #112

Closed bellyjuice closed 2 months ago

bellyjuice commented 2 months ago

my sql is: SELECT vector_column, rowid FROM vector_table WHERE vector_column MATCH ‘[xxxx,xxxx,xxx...]’ ORDER BY distance LIMIT 10 it works well.

but if i add a table and use join query, the sql as below: SELECT vector_column, rowid, raw_data_column FROM vector_table JOIN raw_data_table ON raw_data_table.rowid = vector_table.rowid WHERE vector_column MATCH ‘[xxxx,xxxx,xxx...]’ ORDER BY distance LIMIT 10 the query throw an exception as below: A LIMIT or 'k = ?' constraint is required on vec0 knn queries.

Is there any way to add extra columns to store some extra info for query? There are only 2 columns, we can not filter the query by conditions.

bellyjuice commented 2 months ago

There is alreay a same issue: https://github.com/asg017/sqlite-vec/issues/96