Revision: 1796
Author:
rh...@virginia.edu
Date: Mon Apr 20 20:05:31 2015 UTC
Log: Add custom routine that adds a libloctype_facet which draws its
values from the 999 fields m l and t subfields that match specified patterns
https://code.google.com/p/solrmarc/source/detail?r=1796
Modified:
/trunk/examples/UvaBlacklight/blacklight_index.properties
/trunk/examples/UvaBlacklight/blacklight_test_index.properties
/trunk/examples/UvaBlacklight/src/org/blacklight/BlacklightIndexer.java
=======================================
--- /trunk/examples/UvaBlacklight/blacklight_index.properties Mon Mar 16
18:52:32 2015 UTC
+++ /trunk/examples/UvaBlacklight/blacklight_index.properties Mon Apr 20
20:05:31 2015 UTC
@@ -69,6 +69,8 @@
upc_display = 024a
url_display = custom, getLabelledURLnew("")
+url_supp_display = custom, getLabelledSupplURLnew("")
+
# getLabelledURL - grabs all 856 u fields, if there is a z subfield use
that as a label, otherwise use the default.
#subject_text =
600[a-z]:610[a-z]:611[a-z]:630[a-z]:650[a-z]:651[a-z]:655[a-z]:690[a-z]:520ab
=======================================
--- /trunk/examples/UvaBlacklight/blacklight_test_index.properties Thu Apr
17 20:31:42 2014 UTC
+++ /trunk/examples/UvaBlacklight/blacklight_test_index.properties Mon Apr
20 20:05:31 2015 UTC
@@ -7,3 +7,5 @@
shelfkey = custom, getShelfKey
reverse_shelfkey = custom, getReverseShelfKey
+
+libloctype_facet = custom, getLibLocType("LAW", "SPECCOLL", "RAREBOOK")
=======================================
--- /trunk/examples/UvaBlacklight/src/org/blacklight/BlacklightIndexer.java
Mon Mar 16 15:50:32 2015 UTC
+++ /trunk/examples/UvaBlacklight/src/org/blacklight/BlacklightIndexer.java
Mon Apr 20 20:05:31 2015 UTC
@@ -798,6 +798,28 @@
return resultSet;
} */
+ public Set<String> getLibLocType(final Record record, String libMatch,
String locMatch, String typeMatch)
+ {
+ List<VariableField> lvf = record.getVariableFields("999");
+ Set<String> result = new LinkedHashSet<String>();
+ for (VariableField vf : lvf)
+ {
+ DataField df = (DataField)vf;
+ Subfield lib = df.getSubfield('m');
+ Subfield loc = df.getSubfield('l');
+ Subfield type = df.getSubfield('t');
+ if (lib != null && lib.getData().matches(libMatch) &&
+ loc != null && loc.getData().matches(locMatch) &&
+ type != null && type.getData().matches(typeMatch))
+ {
+ String resultStr = lib.getData() + "_" + loc.getData()
+ "_" + type.getData();
+ result.add(resultStr);
+ }
+ }
+ return(result);
+ }
+
+
/*
* Extract a single cleaned call number from a record
* @param record