I've got a Apache Solr Views display where I'm using "Group By" to group the results by a particular taxonomy term. I'm then sorting the results so the taxonomy terms appear in ascending (alphabetical) order.
It works fine with one exception: If the row doesn't have anything assigned for the particular vocabulary I'm grouping by, those items appear first, they are sorted "Before A" in my alphabetical sort. So, if sorting the terms alphabetically, the 'no term' results are first in the View (because apparently NULL is alphabetically before 'A').
What I want is the terms sorted alphabetically with the 'no term' items LAST.
I mention it's a Solr View because I thought about using the weight of the terms instead of alphabetically (for more control), however relationships don't work in Solr views at all, so that's not an option because I can't get the term weight data.
I think I need to alter the View result programmatically to change the sort order of the 'no term' items and move them to the end of any results, but I can't figure out an effective place to hook in and do it.
Therefore my question is: To manually move some items from a 'group by' view to the end of the list, Which views hook should I use? In that hook, how do I pull out any 'no term' items and put them as the LAST visible results in the view?