diff --git a/module/VuDL/src/VuDL/Connection/Solr.php b/module/VuDL/src/VuDL/Connection/Solr.php index 6abcc03402a2dd57f0f866bba6e2e130e62ffa17..5fa03b15515a03c0cdb0aa51dfdafbf380d732b7 100644 --- a/module/VuDL/src/VuDL/Connection/Solr.php +++ b/module/VuDL/src/VuDL/Connection/Solr.php @@ -206,19 +206,24 @@ class Solr extends AbstractBase /** * Returns file contents of the structmap, our most common call * - * @param string $id record id + * @param string $id record id + * @param array $extra_sort extra fields to sort on * * @return string $id */ - public function getOrderedMembers($id) + public function getOrderedMembers($id, $extra_sort = array()) { // Try to find members in order $seqField = 'sequence_'.str_replace(':', '_', $id).'_str'; + $sort = array($seqField.' asc'); + foreach ($extra_sort as $sf) { + $sort[] = $sf; + } $response = $this->search( new ParamBag( array( 'q' => 'relsext.isMemberOf:"'.$id.'"', - 'sort' => $seqField.' asc,fgs.label asc', + 'sort' => implode(',', $sort), 'fl' => 'id', 'rows' => 99999, )