mirror of
				https://github.com/meilisearch/meilisearch.git
				synced 2025-10-30 23:46:28 +00:00 
			
		
		
		
	fix(search): get sortable_fields only if criteria present
This commit is contained in:
		| @@ -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) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user