Skip to content

Commit

Permalink
fix bugs in searching file using keywords (infiniflow#780)
Browse files Browse the repository at this point in the history
### What problem does this PR solve?


### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
  • Loading branch information
KevinHuSh committed May 15, 2024
1 parent 626ace8 commit d8c080e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions api/db/services/file_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ def get_by_pf_id(cls, tenant_id, pf_id, page_number, items_per_page,
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:
Expand Down
2 changes: 1 addition & 1 deletion api/db/services/task_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def do_cancel(cls, id):
return doc.run == TaskStatus.CANCEL.value or doc.progress < 0
except Exception as e:
pass
return True
return False

@classmethod
@DB.connection_context()
Expand Down

0 comments on commit d8c080e

Please sign in to comment.