Opened 7 years ago
Last modified 6 years ago
#1656 reopened enhancement
Creator sort should include firstName
| Reported by: | dstillman | Owned by: | dstillman |
|---|---|---|---|
| Priority: | minor | Milestone: | |
| Component: | interface | Version: | 2.1 |
| Keywords: | Cc: | fbennett |
Description
http://forums.zotero.org/discussion/8057/#Item_4
This may be tricky given that it sorts by firstCreator, not lastName
Change History (4)
comment:1 Changed 6 years ago by dstillman
- Resolution set to fixed
- Status changed from new to closed
comment:2 Changed 6 years ago by fbennett
- Resolution fixed deleted
- Status changed from closed to reopened
Reopening this, but in connection with the multilingual branch only.
I'm wavering a little over what to do with multilingual sorting of creators, so this is as much a call for guidance as an idea for review.
The multilingual branch (as of today) provides a virtual field 'sortCreator' on all items, which is sql-generated, like firstCreator. Its content is a sort key consisting of (at max) the first three lastName values for author, editor, or contributor. (Note that the multilingual version needs to generate the creators sort key with a separate virtual field, in any case, to support discretionary sort fields.)
I'm wondering if simply extending this sort key field (which never displays) to include firstName values might provide a simple (and possibly faster-running) solution to the sort issue raised in the thread.
(For reference, here's the sql for the sortCreator field.)
Separately, the poster in the thread seems to want items to be distinguished visually in the listing as well. Some visual cue seems to be needed, but (after thinking about it a little) dynamically toggling firstName values on for ambiguous entries only seems likely to lead to madness. Maybe including the first initial would be an adequate compromise: would it be excessively cluttered to display personal names in the listing uniformly in a form like "Galbraith [J]", say?
comment:3 Changed 6 years ago by fbennett
Oops. I missed that the names need to be handled atomically in the sort. Dan's patch is the only way to go. I'll simplify the multilingual sort field to provide only one lastName value; that will eliminate the need for the regexp at the top of the sort evaluation. I'll also stir in a limit on the number of names -- we had a performance complaint against citeproc-js recently, relating to an item (in production data, unfortunately) with 2,000 authors, so it's a problem worth heading off.
I'll leave the ticket open, for the initials thing.
comment:4 Changed 6 years ago by fbennett
- Cc fbennett added
(In [7513]) Closes #1656, Creator sort should include firstName
Needs some testing
Also cleaned up sorting code a little bit