Skip to content

Commit

Permalink
Use homedir to isolate the search.
Browse files Browse the repository at this point in the history
  • Loading branch information
chandra-tacc committed Nov 6, 2023
1 parent b51c41f commit 18178fd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions server/portal/apps/site_search/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ def cms_search(query_string, offset=0, limit=10):
return total, results


def files_search(client, query_string, system, filter=None, offset=0, limit=10):
res = search_operation(client, system, '/', offset=offset, limit=limit,
def files_search(client, query_string, system, path, filter=None, offset=0, limit=10):
res = search_operation(client, system, path, offset=offset, limit=limit,
query_string=query_string, filter=filter)
return (res['count'], res['listing'])

Expand Down Expand Up @@ -65,7 +65,7 @@ def get(self, request, *args, **kwargs):
and ('siteSearchPriority' in conf and conf['siteSearchPriority'] is not None))
client = request.user.tapis_oauth.client if (request.user.is_authenticated and request.user.profile.setup_complete) else service_account()
(public_total, public_results) = \
files_search(client, qs, public_conf['system'], filter=filter,
files_search(client, qs, public_conf['system'], public_conf.get("homeDir", "/"), filter=filter,
offset=offset, limit=limit)
response['public'] = {'count': public_total,
'listing': public_results,
Expand All @@ -84,7 +84,7 @@ def get(self, request, *args, **kwargs):
and ('siteSearchPriority' in conf and conf['siteSearchPriority'] is not None))
client = request.user.tapis_oauth.client
(community_total, community_results) = \
files_search(client, qs, community_conf['system'], filter=filter,
files_search(client, qs, community_conf['system'], community_conf.get("homeDir", "/"), filter=filter,
offset=offset,
limit=limit)
response['community'] = {'count': community_total,
Expand Down

0 comments on commit 18178fd

Please sign in to comment.