From 74315b4ea83573e695585166f65d590511178d83 Mon Sep 17 00:00:00 2001 From: Louis Dureuil Date: Wed, 12 Jul 2023 10:08:29 +0200 Subject: [PATCH] Fixes #3911 --- milli/src/search/new/mod.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/milli/src/search/new/mod.rs b/milli/src/search/new/mod.rs index 034b279ad..5da344014 100644 --- a/milli/src/search/new/mod.rs +++ b/milli/src/search/new/mod.rs @@ -85,7 +85,12 @@ impl<'ctx> SearchContext<'ctx> { let searchable_names = self.index.searchable_fields(self.txn)?; let mut restricted_fids = Vec::new(); + let mut contains_wildcard = false; for field_name in searchable_attributes { + if field_name == "*" { + contains_wildcard = true; + continue; + } let searchable_contains_name = searchable_names.as_ref().map(|sn| sn.iter().any(|name| name == field_name)); let fid = match (fids_map.id(field_name), searchable_contains_name) { @@ -132,7 +137,7 @@ impl<'ctx> SearchContext<'ctx> { restricted_fids.push(fid); } - self.restricted_fids = Some(restricted_fids); + self.restricted_fids = (!contains_wildcard).then_some(restricted_fids); Ok(()) }