Skip to content
Snippets Groups Projects
Commit aeac1f61 authored by Demian Katz's avatar Demian Katz
Browse files

Adding getFullCallNumberNormalized indexing routine.

- Resolves VUFIND-598.
parent da98d33c
No related merge requests found
......@@ -6,6 +6,7 @@
* it will be applied during indexing.
*/
import org.marc4j.marc.Record;
import org.solrmarc.tools.CallNumUtils;
// define the base level indexer so that its methods can be called from the script.
// note that the SolrIndexer code will set this value before the script methods are called.
......@@ -101,3 +102,35 @@ public String getCallNumberSubject(Record record, String fieldSpec) {
}
return(null);
}
/**
* Normalize a single LCCN
* @param record
* @param fieldSpec
* @return String Normalized LCCN
*/
public String getFullCallNumberNormalized(Record record) {
return(getFullCallNumberNormalized(record, "099ab:090ab:050ab"));
}
/**
* Normalize a single LCCN
* @param record
* @param fieldSpec
* @return String Normalized LCCN
*/
public String getFullCallNumberNormalized(Record record, String fieldSpec) {
if (fieldSpec != null) {
String cn = indexer.getFirstFieldVal(record, fieldSpec);
try {
return CallNumUtils.getLCShelfkey(cn, null);
} catch(Exception e) {
// Don't bail out of indexing just because of a weird call number!
//System.out.println("getFullCallNumberNormalized error: " + e);
}
}
// If we got this far, we couldn't find a valid value:
return null;
}
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment