Specification Modifier Similar to 'join' but works on multiple Fields?

2 views
Skip to first unread message

Delis, Christopher

unread,
Mar 4, 2019, 1:17:05 PM3/4/19
to solrmarc-tech
I am trying to figure out the best/easiest way to assign 'title' -- which is a string variable -- all of the linked 245ab values.

I've already attempted to use the LNK modifier (see below), but it will return a collection (multiple values) most of the time, e.g.,

title = 245ab:LNK245ab

ERROR [SolrUpdate-8056114-8056114] (Indexer.java:464) - Error from server at http://localhost:8080/solr/biblio: ERROR: [doc=UIUdb.8056114] multiple values encountered for non multiValued field title: [Bi jiao jing xue., 比较经学.]

My goal is to concatenate all of the returned values into a single string. Is there a builtin modifier that can do this? I've also attempted to use 'join', but it, too, returns multiple values, e.g.,

title = 245ab:LNK245ab, join(" ")

ERROR [SolrUpdate-8056114-8056114] (Indexer.java:464) - Error from server at http://localhost:8080/solr/biblio: ERROR: [doc=UIUdb.8056114] multiple values encountered for non multiValued field title: [Bi jiao jing xue., 比较经学.]

I'm assuming that 'join' works on subfields only (joining the 245$a and 245$b with a space). Is there an analog to 'join' that will join multiple fields into one? It just seems like there must be a way to do this using a builtin feature that I'm not aware of. I was hoping I could do away without writing a custom method for 'title'.

If I do end up writing a custom method for 'title', can I call the getLinkedFieldCombined(fieldSpec) method ( https://github.com/solrmarc/solrmarc/wiki/Predefined-Custom-Methods ) from within my custom method? If so, how might I do this?

Thanks,
Chris


Delis, Christopher

unread,
Mar 5, 2019, 11:10:39 AM3/5/19
to solrma...@googlegroups.com
I'm guessing that the best way to handle this situation is to simply split the title into two separate fields? This is what I have decided to do, anyway.

________________________________________
From: solrma...@googlegroups.com <solrma...@googlegroups.com> on behalf of Delis, Christopher <ced...@uillinois.edu>
Sent: Monday, March 4, 2019 12:17 PM
To: solrmarc-tech
Subject: [solrmarc-tech] Specification Modifier Similar to 'join' but works on multiple Fields?
--
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 post to this group, send email to solrma...@googlegroups.com.
Visit this group at https://groups.google.com/group/solrmarc-tech.
For more options, visit https://groups.google.com/d/optout.

Demian Katz

unread,
Mar 5, 2019, 1:43:04 PM3/5/19
to solrma...@googlegroups.com
Chris,

Sorry for not responding sooner -- I was holding back in case Bob came up with an amazing quick solution. 😊 It does seem to me that it would make sense to have a modifier that merges together a set into a string, but I'm not sure without digging into the code whether it already exists. I imagine it would be a useful addition if it's not already there.

In any case, if your current workaround solution meets your needs, maybe it's a moot point... but if you'd like me to delve deeper into things, let me know and I'll try to find a few minutes to take a closer look.

- Demian

-----Original Message-----
From: solrma...@googlegroups.com <solrma...@googlegroups.com> On Behalf Of Delis, Christopher
Sent: Tuesday, March 5, 2019 11:10 AM
To: solrma...@googlegroups.com
Subject: [solrmarc-tech] Re: Specification Modifier Similar to 'join' but works on multiple Fields?

I'm guessing that the best way to handle this situation is to simply split the title into two separate fields? This is what I have decided to do, anyway.

________________________________________
From: solrma...@googlegroups.com <solrma...@googlegroups.com> on behalf of Delis, Christopher <ced...@uillinois.edu>
Sent: Monday, March 4, 2019 12:17 PM
To: solrmarc-tech
Subject: [solrmarc-tech] Specification Modifier Similar to 'join' but works on multiple Fields?

I am trying to figure out the best/easiest way to assign 'title' -- which is a string variable -- all of the linked 245ab values.

I've already attempted to use the LNK modifier (see below), but it will return a collection (multiple values) most of the time, e.g.,

title = 245ab:LNK245ab

ERROR [SolrUpdate-8056114-8056114] (Indexer.java:464) - Error from server at http://localhost:8080/solr/biblio: ERROR: [doc=UIUdb.8056114] multiple values encountered for non multiValued field title: [Bi jiao jing xue., 比较经学.]

My goal is to concatenate all of the returned values into a single string. Is there a builtin modifier that can do this? I've also attempted to use 'join', but it, too, returns multiple values, e.g.,

title = 245ab:LNK245ab, join(" ")

ERROR [SolrUpdate-8056114-8056114] (Indexer.java:464) - Error from server at http://localhost:8080/solr/biblio: ERROR: [doc=UIUdb.8056114] multiple values encountered for non multiValued field title: [Bi jiao jing xue., 比较经学.]

I'm assuming that 'join' works on subfields only (joining the 245$a and 245$b with a space). Is there an analog to 'join' that will join multiple fields into one? It just seems like there must be a way to do this using a builtin feature that I'm not aware of. I was hoping I could do away without writing a custom method for 'title'.

If I do end up writing a custom method for 'title', can I call the getLinkedFieldCombined(fieldSpec) method ( https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fsolrmarc%2Fsolrmarc%2Fwiki%2FPredefined-Custom-Methods&amp;data=02%7C01%7Cdemian.katz%40villanova.edu%7C8600877b131540abe26808d6a1851c98%7C765a8de5cf9444f09cafae5bf8cfa366%7C0%7C0%7C636873990418744767&amp;sdata=6%2BQ6AXI%2FXDYmYtItanlryj%2FoAGVD9skCa31Z%2FiOnU%2Bs%3D&amp;reserved=0 ) from within my custom method? If so, how might I do this?

Thanks,
Chris


--
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 post to this group, send email to solrma...@googlegroups.com.
Visit this group at https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fgroup%2Fsolrmarc-tech&amp;data=02%7C01%7Cdemian.katz%40villanova.edu%7C8600877b131540abe26808d6a1851c98%7C765a8de5cf9444f09cafae5bf8cfa366%7C0%7C0%7C636873990418744767&amp;sdata=QMeb8AgqnYck2BT2DdOLYbEF3nAjf1mLoMHxIuBneY8%3D&amp;reserved=0.
For more options, visit https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Foptout&amp;data=02%7C01%7Cdemian.katz%40villanova.edu%7C8600877b131540abe26808d6a1851c98%7C765a8de5cf9444f09cafae5bf8cfa366%7C0%7C0%7C636873990418744767&amp;sdata=Jm94we0xaeAnY5uMWMrCpJMFKrDmMSq4R5%2BwnAdDQbc%3D&amp;reserved=0.

--
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 post to this group, send email to solrma...@googlegroups.com.
Visit this group at https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fgroup%2Fsolrmarc-tech&amp;data=02%7C01%7Cdemian.katz%40villanova.edu%7C8600877b131540abe26808d6a1851c98%7C765a8de5cf9444f09cafae5bf8cfa366%7C0%7C0%7C636873990418744767&amp;sdata=QMeb8AgqnYck2BT2DdOLYbEF3nAjf1mLoMHxIuBneY8%3D&amp;reserved=0.
For more options, visit https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Foptout&amp;data=02%7C01%7Cdemian.katz%40villanova.edu%7C8600877b131540abe26808d6a1851c98%7C765a8de5cf9444f09cafae5bf8cfa366%7C0%7C0%7C636873990418744767&amp;sdata=Jm94we0xaeAnY5uMWMrCpJMFKrDmMSq4R5%2BwnAdDQbc%3D&amp;reserved=0.
Reply all
Reply to author
Forward
0 new messages