Hi Tod,

Apologies for the delay in  replying - I lost this e-mail in the mountain of e-mails I had after the New Year.

I have managed to get the items to display in the correct order with some custom indexing but I hit a snag with the ultimate goal of my attempts which was to add call number range searching.

getFullNormalizedLCCN.bsh

import org.marc4j.marc.Record;
import org.solrmarc.tools.CallNumUtils;
org.solrmarc.index.SolrIndexer indexer = null;

/**
 * Normalize a single LCCN
 * @param lccn
 * @return Normalized LCCN
 */
public String getFullNormalizedLCCN(Record record, String lccn) {

    if (lccn != null) {
   
        lccn = indexer.getFirstFieldVal(record, lccn);
       
        String recordID = "1"; // Need to assign real value from record?

    if (lccn != null) {
   
        String normal = CallNumUtils.getLCShelfkey(lccn, recordID);
 
        if (normal != null) {
            // Send back normalized LCCN:
            return normal;
        }
    }
    }
   
    // If we got this far, we couldn't find a valid value:
    return null;
}

marc_local.properties
callnumber-norm_str=  script(getFullNormalizedLCCN.bsh), getFullNormalizedLCCN(852hi)

schema.xml
<field name="callnumber-search" type="string" indexed="true" stored="true"/>

searches.ini
[Sorting]
; Use the "callnumber" line for LC or the "dewey-sort" line for Dewey Decimal.
; If you want to enable both systems for sorting, you can uncomment both lines,
; but you will need to add some custom text to distinguish between the two.
callnumber-norm_str = sort_callnumber

[DefaultSortingByType]
CallNumber = callnumber-norm_str

Cheers,

Luke

On 12/27/2012 02:36 PM, Tod Olson wrote:
Luke,

Did you ever come up with a solution to this problem?

We're in a similar way, wanting the call number browse to reflect call number shelving order.

-Tod

On May 21, 2012, at 8:22 AM, Osullivan L. <L.Osullivan@swansea.ac.uk> wrote:

Hi Folks,

One of our subject librarians has asked us to change the way results are displayed when a callnumber search is performed.

Basically, if someone searches for PQ239, she would like the results returned to be PQ239, PQ239 > ABC, PQ239 .A22 2011, PQ239 .W55 2011, PQ240, PQ2390 etc

At present, we are getting a lot of PQ2391, PQ2392 etc at the top of our results...

The problem I see it two fold - To get what she ideally wants, we'd need to restrict all callnumber search to exact matches using the callnumber-a field and then create more fields to provide sorting for the rest of the callnumber. Has anyone done something similar?

Thanks,

Luke
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
VuFind-General mailing list
VuFind-General@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vufind-general


-- 
Luke O'Sullivan
Systems Developer
Web Team
Swansea University, Singleton Park, Swansea SA2 8PP, UK
l.osullivan@swansea.ac.uk
01792 602772
@l_os_cymru