Sort on first field when it has multiple values
robertDouglass - November 6, 2009 - 10:25
| Project: | Apache Solr Biblio |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | won't fix |
Description
Citations often have multiple values per field. In order to sort on one of these fields, the first value in the array can be used. This code adds the fields to the index by detecting fields with multiple values and adding the first one to an extra sorting field in the index.
| Attachment | Size |
|---|---|
| sorts.patch | 4.45 KB |

#1
Re-rolled patch to remove changes to CVS headers. Not reviewed yet.
#2
I think I prefer something more along the lines of this:
<?php$sort_index_key = FALSE;
if ($biblio['multiple']) {
$sort_index_key = 'sort_ss_' . $biblio['name'];
}
?>
#3
Refactoring is for loosers ;-)