Using django-haystack, how do I order results by content type
问题 I'm using django-haystack for a search page on my site, and I want to order all the results by their content type. Is there a way I can do that? To make it simpler, suppose I have a single application and several classes. Thanks in advance 回答1: from How to order search results by Model: You can do SearchQuerySet().order_by('django_ct') . As a warning, this throws out relevancy. The only way to keep relevancy & group by model is either to run many queries (one per model - usually performant