diff --git a/ckan/lib/search/query.py b/ckan/lib/search/query.py index 881ddc96938..9d0cb70f2fc 100644 --- a/ckan/lib/search/query.py +++ b/ckan/lib/search/query.py @@ -264,7 +264,7 @@ def get_all_entity_ids(self, max_results=1000): def get_index(self,reference): query = { 'rows': 1, - 'q': 'name:%s OR id:%s' % (reference,reference), + 'q': 'name:"%s" OR id:"%s"' % (reference,reference), 'wt': 'json', 'fq': 'site_id:"%s"' % config.get('ckan.site_id')} diff --git a/ckan/logic/action/update.py b/ckan/logic/action/update.py index bc282167f98..e0c06ddb825 100644 --- a/ckan/logic/action/update.py +++ b/ckan/logic/action/update.py @@ -1174,7 +1174,7 @@ def process_solr(q): count = 0 q = [] for id in datasets: - q.append('id:%s' % (id)) + q.append('id:"%s"' % (id)) count += 1 if count % BATCH_SIZE == 0: process_solr(' OR '.join(q))