EPrints Technical Mailing List Archive

Message: #02917


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

[EP-tech] Re: Possible Bug? Sort order in browse views. (in 3.3.10)


Hi Mark,

Thanks for the pointers on where to look....All fixed. 

Betsy, the changes I made, if you are interested....

I added an uppercase command into the file perl_lib/EPrints/Extras.pm, 

sub english_title_orderkey 
{
        my( $field, $value, $dataset ) = @_;

        $value =~ s/^[^a-z0-9]+//gi;
#      if( $value =~ s/^(a|an|the) [^a-z0-9]*//i ) { $value .= ", $1"; }

+      $value =uc($value);

        return $value;
}

I also commented out the "if( $value =~ s/^(a|an|the) [^a-z0-9]*//i ) { $value .= ", $1"; }" line as well, since management wanted things sorted by the complete titles name with a/an/the at the front.

Cheers

Matt

-----Original Message-----
From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of Mark Gregson
Sent: Thursday, 17 April 2014 10:17 AM
To: eprints-tech@ecs.soton.ac.uk
Subject: [EP-tech] Re: Possible Bug? Sort order in browse views. (in 3.3.10)

EPrints' DB is configured to do binary collation.  The standard way of modifying the sort behaviour would be to set make_single_value_orderkey for the title field and force the first letter to upper/lower case after switching the initial articles to the end.

Cheers
Mark

Mark Gregson | Applications and Development Team Leader Library eServices | Queensland University of Technology Level 3 | R Block | Kelvin Grove Campus | GPO Box 2434 | Brisbane 4001
Phone: +61 7 3138 3782 | Web: http://eprints.qut.edu.au/
ABN: 83 791 724 622
CRICOS No: 00213J



-----Original Message-----
From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of Matthew Brady
Sent: Thursday, 17 April 2014 8:41 AM
To: eprints-tech@ecs.soton.ac.uk
Subject: [EP-tech] Re: Possible Bug? Sort order in browse views. (in 3.3.10)

Hi Betsy,

That makes sense now... The sorting (if I understand correctly) is using the eprints__ordervalues_en table and the field called 'title' contains details such as:

	Rigours of Teaching in 1930s, The
	Analysis of Sport Consumption, An
	rural party in an urban nation, A

I will look into the code a little today, and see if I can trace it, and force it to normalize case when performing the sort.

Cheers
Matt



-----Original Message-----
From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of Betsy Coles
Sent: Wednesday, 16 April 2014 6:13 PM
To: eprints-tech@ecs.soton.ac.uk
Subject: [EP-tech] Re: Possible Bug? Sort order in browse views. (in 3.3.10)

Matthew,

We hadn't noticed this, but you're quite right about the two separate sort sequences, one following the other.  It looks to me like initial articles ("A", "An", "The") are being correctly ignored in both sequences; the difference is that the first significant word in each title in the first sequence begins with an uppercase letter, while the titles in the second sequence begin with a lowercase letter.  And all uppercase letters A-Z sort before all lowercase a-z.  This is easier to see on the Caltech page you link to, since there are more entries.

So whatever is creating the sort keys is correctly removing initial articles but failing to normalize case. I've had a quick look and can't find the code that creates the sort keys (it's past midnight here) -- will look some more in the morning.

Betsy Coles
Caltech Library IT Group
bcoles@caltech.edu

________________________________
From: eprints-tech-bounces@ecs.soton.ac.uk [eprints-tech-bounces@ecs.soton.ac.uk] on behalf of Matthew Brady [Matthew.Brady@usq.edu.au]
Sent: Tuesday, April 15, 2014 10:43 PM
To: eprints-tech@ecs.soton.ac.uk
Subject: [EP-tech] Possible Bug? Sort order in browse views. (in 3.3.10)

Hi All,

An academic has noted that the papers in their browse view aren't being listed in the correct order... eg (http://eprints.usq.edu.au/view/uniqueauthor/141.html within 2013, there are 2 at the bottom starting with 'A').  My initial thoughts were I had fudged something while I was reworking the AuthorID code into the browse 3.3.10 framework.  I checked http://authors.library.caltech.edu/view/year/1930.html as well, as they have a stock standard install of 3.3.10 and its happening there as well.

There appear to be two sorted lists that get stacked together.....
The first list is sorted correctly,
The second list contains titles that start with "A", "An", "The" which are sorted in the correct order (if you ignore the "A", "An", "The" at the front..)

Has anyone else noticed this?

Cheers

Matt



_____________________________________________________________
This email (including any attached files) is confidential and is for the intended recipient(s) only. If you received this email by mistake, please, as a courtesy, tell the sender, then delete this email.

The views and opinions are the originator's and do not necessarily reflect those of the University of Southern Queensland. Although all reasonable precautions were taken to ensure that this email contained no viruses at the time it was sent we accept no liability for any losses arising from its receipt.

The University of Southern Queensland is a registered provider of education with the Australian Government.
(CRICOS Institution Code QLD 00244B / NSW 02225M, TEQSA PRV12081 )


*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** Archive: http://www.eprints.org/tech.php/
*** EPrints community wiki: http://wiki.eprints.org/
*** EPrints developers Forum: http://forum.eprints.org/


_____________________________________________________________
This email (including any attached files) is confidential and is for the intended recipient(s) only. If you received this email by mistake, please, as a courtesy, tell the sender, then delete this email.

The views and opinions are the originator's and do not necessarily reflect those of the University of Southern Queensland. Although all reasonable precautions were taken to ensure that this email contained no viruses at the time it was sent we accept no liability for any losses arising from its receipt.

The University of Southern Queensland is a registered provider of education with the Australian Government.
(CRICOS Institution Code QLD 00244B / NSW 02225M, TEQSA PRV12081 )


*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** Archive: http://www.eprints.org/tech.php/
*** EPrints community wiki: http://wiki.eprints.org/
*** EPrints developers Forum: http://forum.eprints.org/

*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** Archive: http://www.eprints.org/tech.php/
*** EPrints community wiki: http://wiki.eprints.org/
*** EPrints developers Forum: http://forum.eprints.org/


_____________________________________________________________
This email (including any attached files) is confidential and is for the intended recipient(s) only. If you received this email by mistake, please, as a courtesy, tell the sender, then delete this email.

The views and opinions are the originator's and do not necessarily reflect those of the University of Southern Queensland. Although all reasonable precautions were taken to ensure that this email contained no viruses at the time it was sent we accept no liability for any losses arising from its receipt.

The University of Southern Queensland is a registered provider of education with the Australian Government.
(CRICOS Institution Code QLD 00244B / NSW 02225M, TEQSA PRV12081 )