Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Sort Haystack SearchResults
from haystack.views import SearchView
class CustomSearch(SearchView):
def extra_context(self):
seg_results = {}
for result in self.results:
if not result.model_name in seg_results:
seg_results[result.model_name] = [result]
else:
seg_results[result.model_name].append(result)
return {'sorted_results':seg_results}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.