Skip to content

Commit

Permalink
fix: set order direction explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmad-mtos committed Jan 13, 2025
1 parent 3c9e5ee commit aff6bd4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions memory-store/migrations/000022_vector_search.up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ BEGIN
AND (d.embedding <=> $1) <= $2
%s
%s
ORDER BY (d.embedding <=> $1)
ORDER BY (d.embedding <=> $1) ASC
LIMIT ($3 * 4) -- Get more candidates than needed
)
SELECT DISTINCT ON (doc_id) *
FROM ranked_docs
ORDER BY doc_id, distance
ORDER BY doc_id, distance ASC
LIMIT $3',
owner_filter_sql,
metadata_filter_sql
Expand Down

0 comments on commit aff6bd4

Please sign in to comment.