From: Bryan Date: Thu, 2 Jan 2014 04:23:21 +0000 (-0500) Subject: resolving erroneous merge conflict of search.py X-Git-Tag: release-20150131~338 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=69343149f50881a5392b47f4e2c176a161cd4171;p=oweals%2Fkarmaworld.git resolving erroneous merge conflict of search.py --- 69343149f50881a5392b47f4e2c176a161cd4171 diff --cc karmaworld/apps/notes/search.py index 139be83,afff889..039a273 --- a/karmaworld/apps/notes/search.py +++ b/karmaworld/apps/notes/search.py @@@ -41,10 -44,12 +41,12 @@@ def search(query, course_id=None) """Returns note IDs matching the given query, filtered by course ID if given""" if course_id: - results = index.search('(text:"%s" OR name:"%s") AND course_id:%s' % (query, query, course_id)) + real_query = '("%s" OR name:"%s") AND course_id:%s' % (query, query, course_id) else: - results = index.search('text:"%s" OR name:"%s"' % (query, query)) + real_query = '"%s" OR name:"%s"' % (query, query) - matching_note_ids = [r['docid'] for r in results['results']] + raw_results = index.search(real_query, snippet_fields=['text']) - return matching_note_ids + results = {r['docid']: r['snippet_text'] for r in raw_results['results']} + - return results ++ return results