Question on "join" modifier

6 views
Skip to first unread message

Mario Trojan

unread,
Aug 15, 2019, 7:50:12 AM8/15/19
to solrmarc-tech
Hi all,

i tried to use the "join" modifier for the first time:

title_full = 245[a-z]:246[a-z], join(" / ")

Having a look at the wiki page (context getAllAlphaSubfields):

The definition is:
"join" - all the values indicated by the !fieldSpec will be concatenated into a single value.

But when importing, i get the following error message:
multiple values encountered for non multiValued field title_full

Am i doing anything wrong, or is "join" not working as expected?

Regards,
Mario

Demian Katz

unread,
Aug 15, 2019, 8:17:45 AM8/15/19
to solrma...@googlegroups.com

Mario,

 

If I’m understanding correctly, I think the join operator lets you customize how subfields are joined together within each field, but it does not join the values of multiple fields together. It is defined more clearly here:

 

https://github.com/solrmarc/solrmarc/wiki/Specification-Modifiers

 

I don’t think there is an existing modifier to join fields together (though Bob will correct me if I am mistaken). Perhaps we do need a joinfields modifier as a complement to the existing unique/notunique/first/notfirst/all family of existing modifiers. In the meantime, you might have to write a custom method to accomplish your goal.

 

- 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://groups.google.com/d/msgid/solrmarc-tech/0ebffb5f-b5a2-47eb-a793-684007aa4f64%40googlegroups.com.

Haschart, Robert J (rh9ec)

unread,
Aug 15, 2019, 10:47:27 AM8/15/19
to solrma...@googlegroups.com

Mario,


Demian is right. The join operator only operates on subfields from within the same field.  


There is a custom method that can be found in the github repo:    https://github.com/solrmarc/custom_methods


In the source file:


https://github.com/solrmarc/custom_methods/tree/master/JoinFieldsMixin/src/org/solrmarc/mixin/JoinFieldsMixin.java


named     getComplexJoinedFields     which can accept two complete separate index specification definitions,  evaluate them, and concatenate the results  out to a single joined field.


For example using that method with the following index specification:


title_full = getComplexJoinedFields("245[a-z]", "246[a-z], first", " / ")


on the following example record:

LEADER 02155cgm a2200349Ia 4500
001 u3514547
003 OCoLC
005 20030205115407.0
007 vd cvaiz
008 020801s1999    cau145            vleng d
028 42$a2232$bPassport
035   $a(Sirsi) o50282383
040   $aIAM$cIAM
245 00$aHollywood musicals of the 1960's$h[videorecording].
246 1 $iTitle on container and disc label:$aHollywood musicals of the 60's
246 30$aMusicals of the 60's
260   $aNorth Hollywood, CA :$bPassport Video,$cc1999.
300   $a1 videodisc (145 min.) :$bsd., col. & b&w ;$c4 3/4 in.
505 0 $aMy fair Lady -- Mary Poppins -- Music Man -- West Side story -- Sound of music -- Finian's rainbow -- Bells are ringing -- Star! -- Paint your wagon -- Gypsy -- Oliver! -- Camelot -- Funny girl -- Darling Lili -- Hello, Dolly! -- Dr. Dolittle -- Bye, bye birdie -- Sweet Charity -- Chitty chitty bang bang -- How to succeed in business without really trying -- Thoroughly modern Millie -- Help! -- Hard days's night -- Yellow submarine -- On a clear day you can see forever -- plus, a rarely seen featurette detailing The Making of funny girl starring Barbra Streisand...
508   $aDirector, Everette Jbob Webber ; producer, Dante J. Pugliese ; writer, Chris Case.
511 1 $aJulie Andrews, Audrey Hepburn, Judy Holliday, Rex Harrison, Vanessa Redgrave, Dick Van Dyke, Shirley Jones, Natalie Wood, Rosalind Russell, Dean Martin, Mary Tyler Moore, Rock Hudson, Robert Preston, Richard Harris, Frank Sinatra, Shirley MacLaine, Ann-Margret, Janet Leigh, and more.
520   $aCelebrate the musicals of the 1960's and go behind the scenes to see how these musicals were made.
538   $aDVD.
596   $a20
650  0$aMotion pictures$zUnited States$xHistory.
655  0$aDocumentary films.
655  0$aMusical films$zUnited States$xHistory and criticism.
700 1 $aWebber, Everette Jbob.
700 1 $aPugliese, Dante J.
710 2 $aPassport Video.
994   $aZ0$bVA@
999   $aVIDEO .DVD01411$wALPHANUM$c1$iX004402949$d9/14/2005$e9/12/2005$lVAULT$mMEDIA-CTR$n8$rY$sY$tVIDEO-DVD$u3/11/2000$xMEMBERCOPY


would produce the following entry in the solr index:


title_full : Hollywood musicals of the 1960's [videorecording]. / Title on container and disc label: Hollywood musicals of the 60's


In order to use the above method the source file    JoinFieldsMixin.java  
needs to be placed in the   index_java/src   directory  of VuFind's SolrMarc installation  or in the VuFindLocal/index_java/src     directory.
Demian can probably help with the specific directory that should be used.

I'll be out of office tomorrow through Wednesday of next week.

-Bob Haschart



From: solrma...@googlegroups.com <solrma...@googlegroups.com> on behalf of Demian Katz <demia...@villanova.edu>
Sent: Thursday, August 15, 2019 8:17 AM
To: solrma...@googlegroups.com <solrma...@googlegroups.com>
Subject: RE: [EXTERNAL] [solrmarc-tech] Question on "join" modifier
 

Demian Katz

unread,
Aug 15, 2019, 10:54:36 AM8/15/19
to solrma...@googlegroups.com

Thanks, Bob!

 

Mario, as Bob says, if you have trouble getting the custom code to compile, let me know. I think as long as you put it under $VUFIND_LOCAL_DIR/import/index_java/src it should work.

 

- Demian

Mario Trojan

unread,
Aug 16, 2019, 8:57:50 AM8/16/19
to solrmarc-tech
Thanks for the answers!

I'm not sure if Bob's solution with the [a-z] will really get the content that we want, but we already have a custom SolrMarc mixin that includes other scripts from VuFind's index_java, so it will be pretty easy to write another custom function.

- Mario

To unsubscribe from this group and stop receiving emails from it, send an email to solrma...@googlegroups.com.

--
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 solrma...@googlegroups.com.

--
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 solrma...@googlegroups.com.

Demian Katz

unread,
Aug 16, 2019, 9:01:12 AM8/16/19
to solrma...@googlegroups.com

Great – good luck, and let us know if we can do more to help!

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://groups.google.com/d/msgid/solrmarc-tech/e4cd2b45-b5e9-4a44-8248-033b228f67ba%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages