Mike,

Thanks for looking into this. Can you or anyone else tell me if I can just 
re-declare the two updated stored procedures (see below) and re-ingest the auth 
records on my test server to see the code in action? I guess I can just build a 
new test VM, but I want to know if I have another option.

Also, I made a mistake in my example when I placed the "Jazz England" auth 
record at the bottom. Thanks for catching that Mike.

Yamil



-------------------------

CREATE OR REPLACE FUNCTION authority.normalize_heading( marcxml TEXT, 
no_thesaurus BOOL ) RETURNS TEXT AS $func$
DECLARE
    acsaf           authority.control_set_authority_field%ROWTYPE;
    tag_used        TEXT;
    nfi_used        TEXT;
    sf              TEXT;
    sf_node         TEXT;
 
 
 <snip>
 
 
END;
$func$ LANGUAGE PLPGSQL IMMUTABLE;
 
-------


CREATE OR REPLACE FUNCTION authority.simple_heading_set( marcxml TEXT ) RETURNS 
SETOF authority.simple_heading AS $func$
DECLARE
    res             authority.simple_heading%ROWTYPE;
    acsaf           authority.control_set_authority_field%ROWTYPE;

<snip>

END;
$func$ LANGUAGE PLPGSQL IMMUTABLE;




On Jun 25, 2013, at 10:13 AM, Mike Rylander <[email protected]> wrote:

> Actually, on second thought, I think that bug is fine for this.  I'll
> just use that.  See:
> http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/collab/miker/authority-sf-file-order
> 
> --miker
> 
> 
> On Tue, Jun 25, 2013 at 9:21 AM, Mike Rylander <[email protected]> wrote:
>> The primary cause of the sort order you're seeing is the code at lines
>> 277 through 279 of Open-ILS/src/sql/Pg/011.schema.authority.sql.
>> 
>> For each tag that we're going turn into simple heading, primarily for
>> browsing authority records, we look only at the subfields that we've
>> been told to.  However, instead of looping over the subfields in
>> record-order, we pull them out of the tag in configuration order.
>> IOW, record order is not preserved for sorting.
>> 
>> I think this needs a new bug, since the old one you pointed out has a
>> muddled history, and doesn't call out the problem specifically.
>> 
>> The fix for this is relatively straight forward, and I'll see if I can
>> put that together soon.
>> 
>> One last thing, however, regarding your cataloger's desired sort
>> order; it would look like the following (note the placement of the
>> "Jazz -- England" line in your desired example):
>> 
>> 150 $aJazz
>> 
>> 150 $aJazz $y1921-1930
>> 
>> 150 $aJazz  $y1931-1940
>> 
>> 150 $aJazz  $y1941-1950
>> 
>> 150 $aJazz  $zEngland $y1941-1950.
>> 
>> 150 $aJazz  $zFrance   $zParis   $y1921-1930.
>> 
>> 150 $aJazz  $zFrance   $zParis   $y1931-1940.
>> 
>> 150 $aJazz  $zFrance   $zParis   $y1941-1950.
>> 
>> 150 $aJazz $zNorth Carolina $zGastonia $y1921-1930.
>> 
>> 150 $aJazz $zNorth Carolina $zGastonia $y1931-1940.
>> 
>> 
>> On Mon, Jun 24, 2013 at 5:16 PM, Yamil Suarez <[email protected]> wrote:
>>> Hello,
>>> 
>>> My catalogers are confused by how authorities are sorted in the cataloging 
>>> "manage authorities" view. I wanted to understand the approach being taken 
>>> by the current code, versus what the catalogers are expecting.
>>> 
>>> 
>>> For example in our EG 2.2 and our now EG 2.4 system if we search for 
>>> subject "jazz" the results look something like this (though the sub-field 
>>> letters are not displayed)…
>>> 
>>> 
>>> 150 $aJazz
>>> 
>>> 150 $aJazz $y1921-1930
>>> 
>>> 150 $aJazz  $zFrance   $zParis   $y1921-1930.
>>> 
>>> 150 $aJazz $zNorth Carolina $zGastonia $y1921-1930.
>>> 
>>> 150 $aJazz  $y1931-1940
>>> 
>>> 150 $aJazz  $zFrance   $zParis   $y1931-1940.
>>> 
>>> 150 $aJazz $zNorth Carolina $zGastonia $y1931-1940.
>>> 
>>> 150 $aJazz  $y1941-1950
>>> 
>>> 150 $aJazz  $zEngland $y1941-1950.
>>> 
>>> 150 $aJazz  $zFrance   $zParis   $y1941-1950.
>>> 
>>> 
>>> The catalogers would prefer that the sorting should instead look like this….
>>> 
>>> 150 $aJazz
>>> 
>>> 150 $aJazz $y1921-1930
>>> 
>>> 150 $aJazz  $y1931-1940
>>> 
>>> 150 $aJazz  $y1941-1950
>>> 
>>> 150 $aJazz  $zFrance   $zParis   $y1921-1930.
>>> 
>>> 150 $aJazz  $zFrance   $zParis   $y1931-1940.
>>> 
>>> 150 $aJazz  $zFrance   $zParis   $y1941-1950.
>>> 
>>> 150 $aJazz $zNorth Carolina $zGastonia $y1921-1930.
>>> 
>>> 150 $aJazz $zNorth Carolina $zGastonia $y1931-1940.
>>> 
>>> 150 $aJazz  $zEngland $y1941-1950.
>>> 
>>> 
>>> Which is the way that the authorities searches look like within OCLC 
>>> Connexion client when searching the OCLC authority file. I wonder if part 
>>> of the confusion is that sometimes authority subfield letters are not sued 
>>> in alphabetical order. For example, in these subject authority the subfield 
>>> are used in this order $a, $z, $y.
>>> 
>>> My understanding is that this old LP bug is referring to this sorting issue.
>>> 
>>> https://bugs.launchpad.net/evergreen/+bug/781008
>>> 
>>> This old bug needs to be re-filed because it combined more than one issue 
>>> at a time, and I am just trying to research authority sorting to see if it 
>>> should be refiled or turned into a wish-list item, etc.
>>> 
>>> Thanks in advance,
>>> Yamil
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>> 
>> 
>> 
>> --
>> Mike Rylander
>> | Director of Research and Development
>> | Equinox Software, Inc. / Your Library's Guide to Open Source
>> | phone:  1-877-OPEN-ILS (673-6457)
>> | email:  [email protected]
>> | web:  http://www.esilibrary.com
> 
> 
> 
> -- 
> Mike Rylander
> | Director of Research and Development
> | Equinox Software, Inc. / Your Library's Guide to Open Source
> | phone:  1-877-OPEN-ILS (673-6457)
> | email:  [email protected]
> | web:  http://www.esilibrary.com

Reply via email to