Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Commit

Permalink
fix(search): get sortable_fields only if criteria present
Browse files Browse the repository at this point in the history
  • Loading branch information
shekhirin committed Aug 31, 2021
1 parent d6bba06 commit 0e37955
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion milli/src/search/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ impl<'a> Search<'a> {

// We check that we are allowed to use the sort criteria, we check
// that they are declared in the sortable fields.
let sortable_fields = self.index.sortable_fields(self.rtxn)?;
if let Some(sort_criteria) = &self.sort_criteria {
let sortable_fields = self.index.sortable_fields(self.rtxn)?;
for asc_desc in sort_criteria {
let field = asc_desc.field();
if !sortable_fields.contains(field) {
Expand Down

0 comments on commit 0e37955

Please sign in to comment.