mirror of
				https://github.com/meilisearch/meilisearch.git
				synced 2025-11-04 01:46:28 +00:00 
			
		
		
		
	Fix filed selector in extrators
This commit is contained in:
		
				
					committed by
					
						
						Clément Renault
					
				
			
			
				
	
			
			
			
						parent
						
							56c7c5d5f0
						
					
				
				
					commit
					fe5d50969a
				
			@@ -174,19 +174,16 @@ pub mod perm_json_p {
 | 
			
		||||
        }) {
 | 
			
		||||
            Selection::Skip
 | 
			
		||||
        } else if let Some(selectors) = selectors {
 | 
			
		||||
            selectors
 | 
			
		||||
                .iter()
 | 
			
		||||
                .filter_map(|selector| {
 | 
			
		||||
                    if contained_in(field_name, selector) {
 | 
			
		||||
                        Some(Selection::Select)
 | 
			
		||||
                    } else if contained_in(selector, field_name) {
 | 
			
		||||
                        Some(Selection::Parent)
 | 
			
		||||
                    } else {
 | 
			
		||||
                        None
 | 
			
		||||
                    }
 | 
			
		||||
                })
 | 
			
		||||
                .next()
 | 
			
		||||
                .unwrap_or(Selection::Skip)
 | 
			
		||||
            let mut selection = Selection::Skip;
 | 
			
		||||
            for selector in selectors {
 | 
			
		||||
                if contained_in(field_name, selector) {
 | 
			
		||||
                    selection = Selection::Select;
 | 
			
		||||
                    break;
 | 
			
		||||
                } else if contained_in(selector, field_name) {
 | 
			
		||||
                    selection = Selection::Parent;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            selection
 | 
			
		||||
        } else {
 | 
			
		||||
            Selection::Select
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user