Thankyou for the answer, but I was more talking about a method to actually group the results, not just sort them.
So grouping the results would mean that the list of threads would appear below a header that states the forum they come from. For example:
ForumA: (you click on it and the threads list appear)
Thread 1
Thread 2
Thread 3
ForumB: (you click on it and the threads list appear)
Thread 5
Thread 7
Thread 9
so basically in the results you have a list of the forums in the beginning, not the actual threads. When you click on each forum, you get the threads displayed.