Commit 92040c24 authored by thepaeth's avatar thepaeth
Browse files

fix bug

parent 31895980
...@@ -86,6 +86,8 @@ class HierarchyDisplay(p.SingletonPlugin): ...@@ -86,6 +86,8 @@ class HierarchyDisplay(p.SingletonPlugin):
sub-organizations too. This is achieved by modifying the search options sub-organizations too. This is achieved by modifying the search options
before they go to SOLR. before they go to SOLR.
''' '''
if search_params.get('rows') == 0:
return search_params
# Check if we're called from the organization controller, as detected # Check if we're called from the organization controller, as detected
# by c being registered for this thread, and the existence of c.fields # by c being registered for this thread, and the existence of c.fields
# values # values
...@@ -140,14 +142,14 @@ class HierarchyDisplay(p.SingletonPlugin): ...@@ -140,14 +142,14 @@ class HierarchyDisplay(p.SingletonPlugin):
# add the org clause # add the org clause
query = query.strip() query = query.strip()
if query: if query:
query += ' AND ' query += ' +'
query += '({})'.format( query += '({})'.format(
' OR '.join( ' OR '.join(
'organization:{}'.format(org_name) 'organization:{}'.format(org_name)
for org_name in [c.group_dict.get('name')] + for org_name in [c.group_dict.get('name')] +
children_names)) children_names))
else: else:
query += ' AND (organization:{})'.format(c.group_dict.get('name')) query += ' +(organization:{})'.format(c.group_dict.get('name'))
search_params['q'] = query.strip() search_params['q'] = query.strip()
...@@ -156,7 +158,7 @@ class HierarchyDisplay(p.SingletonPlugin): ...@@ -156,7 +158,7 @@ class HierarchyDisplay(p.SingletonPlugin):
# remove include_children from the filter-list - we have a checkbox # remove include_children from the filter-list - we have a checkbox
del c.fields_grouped['include_children'] del c.fields_grouped['include_children']
search_params['fq'] = '' search_params['fq'] = 'type:dataset'
check_include_children = {} check_include_children = {}
return search_params return search_params
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment