mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-21 07:12:10 +00:00
A vector search operation in Alternator (VectorSearch option to Query) returns items sorted by decreasing similarity to the searched vector. Although the items are sorted by decreasing similarity scores, before this patch the user had no way to see the values of these scores. This patch adds a new VectorSearch option, `ReturnScores`. This option defaults to `NONE`. But if set to `SIMILARITY`, the query will return an array `Scores` with the same length as `Items`, which gives the similarity score for each item. As usual, this patch includes the implementation, the documentation, and tests for the new feature. Signed-off-by: Nadav Har'El <nyh@scylladb.com>