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.

AttachmentSize
sorts.patch4.45 KB

#1

David Lesieur - November 7, 2009 - 04:37

Re-rolled patch to remove changes to CVS headers. Not reviewed yet.

AttachmentSize
sorts-625156-1.patch 2.58 KB

#2

robertDouglass - November 10, 2009 - 13:47
Status:needs review» needs work

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

robertDouglass - November 23, 2009 - 13:26
Status:needs work» won't fix

Refactoring is for loosers ;-)

 
 

Drupal is a registered trademark of Dries Buytaert.