mirror of
				https://github.com/meilisearch/meilisearch.git
				synced 2025-10-31 07:56:28 +00:00 
			
		
		
		
	Fixes #3911
This commit is contained in:
		| @@ -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(()) | ||||
|     } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user