Hi there You'll need to sort by the class, essentially. This is most easily done by adding attributes to each class:
has '1', :as => :class_sort, :type => :integer Make sure the number is different for each model, then run `rake ts:rebuild`, and you can search like this: ThinkingSphinx.search params[:query], classes: [Blog, Article], order: 'class_sort ASC, @weight DESC' Cheers -- Pat On 15/09/2011, at 7:06 PM, okliv wrote: > hi! > > i need to show search results grouped by Model > > for example: > > i have in my controller @results = ThinkingSphinx.search > params[:query], classes: [Blog, Article] > > and so i need to show to user: > > =============== > "5 results found in blog posts" > Blog result 1 > ... > Blog result 5 > ------ > "3 results found in aticles" > Article result 1 > ... > Article result 3 > =============== > > thanx in advance! > > -- > You received this message because you are subscribed to the Google Groups > "Thinking Sphinx" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/thinking-sphinx?hl=en. > -- You received this message because you are subscribed to the Google Groups "Thinking Sphinx" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/thinking-sphinx?hl=en.
