Do you mind exemplifying that? I'll submit the resulting code in a gist that you can share in the knowledgebase since this seems to be a frequent question in stackoverflow etc. I made some suggestions below.
Can you imagine a way where one could programmatically create the indexed array so that you don't have to declare the groups twice? For example, do the following. I'm going backwards from array keys to a string array because I don't know an easy way to create an array of arrays with keys from another string array, that would be a bit more semantically correct.
// Declare keyed arrays for hits sorting
$people_types_keyed = array( "faculty"=>array(), "staff"=>array(), "student"=>array() );
$academic_types_keyed = array ("courses"=>array(), "programs"=>array() );
$types = array_merge($academic_types_keyed, $people_types_keyed);
// insert array push code here
//merge hits back with php5 ... operator, much easier than redeclaring each key.