mirror of
				https://github.com/infiniflow/ragflow.git
				synced 2025-11-03 19:29:43 +00:00 
			
		
		
		
	fix bugs in searching file using keywords (#780)
### What problem does this PR solve? ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
		
							parent
							
								
									626ace8639
								
							
						
					
					
						commit
						d8c080ee52
					
				@ -34,9 +34,9 @@ class FileService(CommonService):
 | 
			
		||||
                     orderby, desc, keywords):
 | 
			
		||||
        if keywords:
 | 
			
		||||
            files = cls.model.select().where(
 | 
			
		||||
                (cls.model.tenant_id == tenant_id)
 | 
			
		||||
                (cls.model.tenant_id == tenant_id),
 | 
			
		||||
                (cls.model.parent_id == pf_id),
 | 
			
		||||
                (fn.LOWER(cls.model.name).like(f"%%{keywords.lower()}%%")),
 | 
			
		||||
                (fn.LOWER(cls.model.name).contains(keywords.lower())),
 | 
			
		||||
                ~(cls.model.id == pf_id)
 | 
			
		||||
            )
 | 
			
		||||
        else:
 | 
			
		||||
 | 
			
		||||
@ -96,7 +96,7 @@ class TaskService(CommonService):
 | 
			
		||||
            return doc.run == TaskStatus.CANCEL.value or doc.progress < 0
 | 
			
		||||
        except Exception as e:
 | 
			
		||||
            pass
 | 
			
		||||
        return True
 | 
			
		||||
        return False
 | 
			
		||||
 | 
			
		||||
    @classmethod
 | 
			
		||||
    @DB.connection_context()
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user