Skip to content

Commit

Permalink
Merge pull request #6865 from haiwen/feat/seasearch-add-dir-filter
Browse files Browse the repository at this point in the history
feat(seasearch): add dir filter
  • Loading branch information
JoinTyang authored Oct 12, 2024
2 parents 6970930 + bb8570c commit cbf832a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion seahub/api2/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ def get(self, request, format=None):
repos = [(repo.id, repo.origin_repo_id, repo.origin_path, repo.name)]

searched_repos, repos_map = format_repos(repos)
results, total = ai_search_files(keyword, searched_repos, per_page, suffixes, search_path)
results, total = ai_search_files(keyword, searched_repos, per_page, suffixes, search_path, obj_type)

for f in results:
repo_id = f['repo_id']
Expand Down
3 changes: 2 additions & 1 deletion seahub/search/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,14 @@ def search_files(repos_map, search_path, keyword, obj_desc, start, size, org_id=
return result, total


def ai_search_files(keyword, searched_repos, count, suffixes, search_path):
def ai_search_files(keyword, searched_repos, count, suffixes, search_path, obj_type):
params = {
'query': keyword,
'repos': searched_repos,
'count': count,
'suffixes': suffixes,
'search_path': search_path,
'obj_type': obj_type
}

resp = search(params)
Expand Down

0 comments on commit cbf832a

Please sign in to comment.