Skip to content

Commit

Permalink
H-2008: Fix root sorting by embedding distance (#3934)
Browse files Browse the repository at this point in the history
  • Loading branch information
TimDiekmann authored Jan 25, 2024
1 parent 57be107 commit 6c15374
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -471,9 +471,11 @@ impl<'p, R: PostgresRecord> SelectCompiler<'p, R> {
});
}

self.statement
.order_by_expression
.push(distance_column, Ordering::Ascending);
self.statement.order_by_expression.insert(
0,
distance_column,
Ordering::Ascending,
);
self.statement
.selects
.push(SelectExpression::from_column(distance_column, None));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ impl OrderByExpression {
self.columns.push((column, ordering));
}

pub fn insert(&mut self, index: usize, column: AliasedColumn, ordering: Ordering) {
self.columns.insert(index, (column, ordering));
}

pub fn is_empty(&self) -> bool {
self.columns.is_empty()
}
Expand Down

0 comments on commit 6c15374

Please sign in to comment.