mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-04-23 06:30:00 +08: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):
|
orderby, desc, keywords):
|
||||||
if keywords:
|
if keywords:
|
||||||
files = cls.model.select().where(
|
files = cls.model.select().where(
|
||||||
(cls.model.tenant_id == tenant_id)
|
(cls.model.tenant_id == tenant_id),
|
||||||
(cls.model.parent_id == pf_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)
|
~(cls.model.id == pf_id)
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
|
@ -96,7 +96,7 @@ class TaskService(CommonService):
|
|||||||
return doc.run == TaskStatus.CANCEL.value or doc.progress < 0
|
return doc.run == TaskStatus.CANCEL.value or doc.progress < 0
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
pass
|
pass
|
||||||
return True
|
return False
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@DB.connection_context()
|
@DB.connection_context()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user