omit field in marc_local.properties?

7 views
Skip to first unread message

Michael Lackhoff

unread,
Apr 3, 2021, 2:47:57 PM4/3/21
to solrma...@googlegroups.com
Hi,

I am in the process of automating my Vufind installation and would like
to avoid editing marc.properties.
All the overrides should go into marc_local.properties but I couldn't
find an easy way to omit the "building" field that is set in
marc.properties. I just want to get rid of it, as I said without
removing it from marc.properties so I have a clean distinction between
the "official" files and my local changes.

What I tried:
building = false # Error
building = null # Error
building = omit # Error
building = "" # keeps empty field
building = 999x ? ($x == "sffsd") # works but is ugly

Is there a better way?

Another question: Is it possible to set upperCaseSubfields in a config
file? It would be nice if I could set it in import.properties but that
doen't seem to have any effect. I had to add
-Dorg.marc4j.MarcPermissiveStreamReader.upperCaseSubfields=true
to the INDEX_OPTIONS environment variable to avoid the uppercase errors.
I would prefer to set it in a config/properties file since maintainance
should be easier if it is not burried within a long variable that has
lots of settings.
Also I would like to have the content related settings separate from the
system specific (like memory settings).

As you can see nothing critical but the necessary customization for the
next install (when I have forgotten all the details from this run) would
be very easy and obvious.

-Michael

Demian Katz

unread,
Apr 3, 2021, 6:11:46 PM4/3/21
to solrma...@googlegroups.com
Regarding the "omit a field" question, I'm surprised that there's not an easy way to do this, but I can't think of anything beyond what you have tried so far. I think if you write a custom routine that simply returns null, that should do the job, but there ought to be an easier way. I think it would be nice to have a "dropFieldIfFieldEmpty" modifier similar to "deleteRecordIfFieldEmpty." Hopefully Bob will step in and provide an answer if there's something I simply don't know about!

As for setting upperCaseSubfields in a config file, I think it was Bob's intent to move away from config files in favor of command line parameters, so the current config file handling is kind of a thin layer designed for backward compatibility, but it may not be forward looking. I agree with you that config files can have some advantages, so I wouldn't mind if this were improved and made more flexible... though it's also been on my radar to consider reworking VuFind's scripting to rely less on configuration files, in case the built-in SolrMarc support goes away in the future. (Though it hasn't gone any further than being generally on my radar, given many other priorities that have taken more of my attention 😊).

- Demian
--
You received this message because you are subscribed to the Google Groups "solrmarc-tech" group.
To unsubscribe from this group and stop receiving emails from it, send an email to solrmarc-tec...@googlegroups.com.
To view this discussion on the web visit https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fsolrmarc-tech%2Fe8cb578f-4638-2a3a-c624-5c20ff9db3e4%2540lackhoff.de&data=04%7C01%7Cdemian.katz%40villanova.edu%7C5e59951d4c394346032508d8f6d100cf%7C765a8de5cf9444f09cafae5bf8cfa366%7C0%7C0%7C637530724824571114%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=7%2BX4ubTGMd6nxehnG%2BgSkavymXhd%2FbNMTa4zpKT1qRQ%3D&reserved=0.

Robert Haschart

unread,
Apr 6, 2021, 1:04:29 PM4/6/21
to solrma...@googlegroups.com
There isn't an existing feature designed to do that.    However there is a feature you can misuse to accomplish that.

building = NOTused

What this does is override the previous existing definition in the default properties file, and replace it with a definition that looks for any and all fields where the field label is the uppercase letters "NOT'  since field labels can be three digits OR three uppercase letters.   Then in the fields that it finds it will try to extract the subfields   $u $s $e $d   but since there (probably) aren't any fields with a label "NOT"  no data will be extracted.

You could use any three uppercase letters as the non-existant field to look for, but something like the above helps the result be (somewhat) self-explanatory.

-Bob Haschart

Reply all
Reply to author
Forward
0 new messages