diff --git a/milli/src/search/new/mod.rs b/milli/src/search/new/mod.rs index e9518bad5..375f7c774 100644 --- a/milli/src/search/new/mod.rs +++ b/milli/src/search/new/mod.rs @@ -330,6 +330,8 @@ pub fn execute_search( ctx.index.documents_ids(ctx.txn)? }; + check_sort_criteria(ctx, sort_criteria.as_ref())?; + let mut located_query_terms = None; let bucket_sort_output = if let Some(query) = query { // We make sure that the analyzer is aware of the stop words @@ -352,8 +354,6 @@ pub fn execute_search( let graph = QueryGraph::from_query(ctx, &query_terms)?; located_query_terms = Some(query_terms); - check_sort_criteria(ctx, sort_criteria.as_ref())?; - let ranking_rules = get_ranking_rules_for_query_graph_search(ctx, sort_criteria, terms_matching_strategy)?;