mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-12-24 13:40:31 +01:00
fix(search): get sortable_fields only if criteria present
This commit is contained in:
parent
d6bba0663a
commit
0e379558a1
@ -145,8 +145,8 @@ impl<'a> Search<'a> {
|
|||||||
|
|
||||||
// We check that we are allowed to use the sort criteria, we check
|
// We check that we are allowed to use the sort criteria, we check
|
||||||
// that they are declared in the sortable fields.
|
// 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 {
|
if let Some(sort_criteria) = &self.sort_criteria {
|
||||||
|
let sortable_fields = self.index.sortable_fields(self.rtxn)?;
|
||||||
for asc_desc in sort_criteria {
|
for asc_desc in sort_criteria {
|
||||||
let field = asc_desc.field();
|
let field = asc_desc.field();
|
||||||
if !sortable_fields.contains(field) {
|
if !sortable_fields.contains(field) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user