EPrints Technical Mailing List Archive

Message: #05575


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

Re: [EP-tech] Search results sorting by compound field elements


Half-answering my own question:

 

my %options = ("custom_order" => "name");

my $list = $ds->search(%options);

 

actually does what I want, but doesn’t resolve the larger question of sorting by sub-fields – e.g. if I wanted to sort the list by given name rather than family name…

 

 

From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of Alan.Stiles
Sent: 20 April 2016 15:28
To: eprints-tech@ecs.soton.ac.uk
Subject: [EP-tech] Search results sorting by compound field elements

 

Hi all,

Anyone got a clue how to format the ‘custom_order’ parameter of a dataset search query to sort by sub-fields of a compound field?

 

i.e. – running a search over the ‘user’ dataset and I want to sort the results by name_family then name_given of the compound ‘name’ field.

 

Currently running (based on the search method from http://wiki.eprints.org/w/API:EPrints/DataSet#Object_Methods ):

 

$list = $ds->search( {“custom_order” => “name_given/name_family” };

 

But it doesn’t seem to be sorting the list at all

 

Thanks,

 

Alan

-- The Open University is incorporated by Royal Charter (RC 000391), an exempt charity in England & Wales and a charity registered in Scotland (SC 038302). The Open University is authorised and regulated by the Financial Conduct Authority.