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.


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;

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

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

; 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

CallNumber = callnumber-norm_str



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

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.


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?


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

Luke O'Sullivan
Systems Developer
Web Team
Swansea University, Singleton Park, Swansea SA2 8PP, UK
01792 602772