diff --git a/saved_search/groupsearch.py b/saved_search/groupsearch.py index 191fc68..c4507aa 100644 --- a/saved_search/groupsearch.py +++ b/saved_search/groupsearch.py @@ -163,9 +163,12 @@ def search(self, query_string, sort_by=None, start_offset=0, end_offset=None, e) raw_results = [EmptyResults()] - return [self._process_results(res, highlight=highlight, - result_class=result_class) - for res in raw_results.grouped.iteritems()] + if hasattr(raw_results, 'grouped'): + return [self._process_results(res, highlight=highlight, + result_class=result_class) + for res in raw_results.grouped.iteritems()] + else: + return [] def _process_results(self, raw_results, highlight=False, result_class=None): from haystack import connections