diff --git a/ckan/lib/search/query.py b/ckan/lib/search/query.py index 1816fa06fdf..df2633a172f 100644 --- a/ckan/lib/search/query.py +++ b/ckan/lib/search/query.py @@ -358,6 +358,9 @@ def run(self, query): query['mm'] = query.get('mm', '2<-1 5<80%') query['qf'] = query.get('qf', QUERY_FIELDS) + # Pop these ones are Solr does not need them + query.pop('extras', None) + conn = make_connection() log.debug('Package query: %r' % query) try: diff --git a/ckan/logic/action/get.py b/ckan/logic/action/get.py index 001f1986301..a130200c7e4 100644 --- a/ckan/logic/action/get.py +++ b/ckan/logic/action/get.py @@ -1243,6 +1243,12 @@ def package_search(context, data_dict): _check_access('package_search', context, data_dict) + # Move ext_ params to extras and remove them from the root of the search + # params, so they don't cause and error + data_dict['extras'] = data_dict.get('extras', {}) + for key in [key for key in data_dict.keys() if key.startswith('ext_')]: + data_dict['extras'][key] = data_dict.pop(key) + # check if some extension needs to modify the search params for item in plugins.PluginImplementations(plugins.IPackageController): data_dict = item.before_search(data_dict)