couchbase-lite-core
couchbase-lite-core copied to clipboard
Support latest vectorsearch (dev branch) and hybrid queries
- Added the official SQLite
carrayextension, because the latestvectorsearchlibrary requires it. - Support for hybrid vector queries, where the vector search is combined with other criteria on the collection:
- When
vector_match()is the only criterion in the WHERE clause, OR if an explicitmax_resultsarg is given, it's a "plain" query like already existed. - Otherwise it's a "hybrid" query, which invokes the vectorsearch extension differently (with a JOIN constraint on its rowid column.) This is less efficient, but computes distances for all the rows selected by the other WHERE tests, instead of just finding the closest docs in the whole collection, so it gives more accurate results.
- In a plain query where there is no
max_resultsgiven, but the query itself has a LIMIT, use the LIMIT as the max_results for the vector query. This is intuitive, and makes it so you only need to use max_results if you want to force a plain vector query in combination with other conditions.
@snej Can you fix the windows build issue so the PR could get reviewed?