Quantcast

Doubt about SolrMarc

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Doubt about SolrMarc

Germán Biozzoli
Hi list

Sorry if it's a trivial question, but I can't find in SolrMarc documentation a way to concatenate two subfields into a Solr one with an specific separator.

I've tried

format = 337a,join(" / "),347b

But, as the documentation says, it will work only for one field, concatenating subfields, third argument is not recognoiced.

format = 337a:337b

It will create an entry for each subfield, if I understand correctly.

Is there an example of concatenating two subfields with an specific char?

Thanks a lot
German

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Doubt about SolrMarc

Robert Haschart
German

I'm the primary developer of SolrMarc, and I cannot think of a way to easily accomplish what you are trying to do.
I'll think about it some more, but at the moment I'm pretty sure that there is no syntax to support that.

-Bob




On 4/26/2017 12:33 PM, Germán Biozzoli wrote:
Hi list

Sorry if it's a trivial question, but I can't find in SolrMarc documentation a way to concatenate two subfields into a Solr one with an specific separator.

I've tried

format = 337a,join(" / "),347b

But, as the documentation says, it will work only for one field, concatenating subfields, third argument is not recognoiced.

format = 337a:337b

It will create an entry for each subfield, if I understand correctly.

Is there an example of concatenating two subfields with an specific char?

Thanks a lot
German


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot


_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Doubt about SolrMarc

Demian Katz

The examples in the original email are inconsistent – one suggests that both subfields are in 337 while one shows 337a and 347b. If both subfields are in 337, can’t you do:

 

337[a-b], join (" / ")

 

?

 

If they’re in separate fields, though, I agree that there doesn’t appear to be a way to do this with the basic spec, though a custom method would probably be fairly easy to develop.

 

- Demian

 

From: Robert Haschart [mailto:[hidden email]]
Sent: Wednesday, April 26, 2017 1:45 PM
To: [hidden email]
Subject: Re: [VuFind-General] Doubt about SolrMarc

 

German

I'm the primary developer of SolrMarc, and I cannot think of a way to easily accomplish what you are trying to do.
I'll think about it some more, but at the moment I'm pretty sure that there is no syntax to support that.

-Bob



On 4/26/2017 12:33 PM, Germán Biozzoli wrote:

Hi list

 

Sorry if it's a trivial question, but I can't find in SolrMarc documentation a way to concatenate two subfields into a Solr one with an specific separator.

 

I've tried

 

format = 337a,join(" / "),347b

 

But, as the documentation says, it will work only for one field, concatenating subfields, third argument is not recognoiced.

 

format = 337a:337b

 

It will create an entry for each subfield, if I understand correctly.

 

Is there an example of concatenating two subfields with an specific char?

 

Thanks a lot

German




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot




_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general

 


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Doubt about SolrMarc

Robert Haschart
Demian is right.  

If you want two subfields from the same MARC field, for instance 337,  it is easy, and you can do it like his example.
If you want a subfield from one field, and another subfield from a different field, then my previous answer applies.

-Bob


On 4/26/2017 2:06 PM, Demian Katz wrote:

The examples in the original email are inconsistent – one suggests that both subfields are in 337 while one shows 337a and 347b. If both subfields are in 337, can’t you do:

 

337[a-b], join (" / ")

 

?

 

If they’re in separate fields, though, I agree that there doesn’t appear to be a way to do this with the basic spec, though a custom method would probably be fairly easy to develop.

 

- Demian

 

From: Robert Haschart [[hidden email]]
Sent: Wednesday, April 26, 2017 1:45 PM
To: [hidden email]
Subject: Re: [VuFind-General] Doubt about SolrMarc

 

German

I'm the primary developer of SolrMarc, and I cannot think of a way to easily accomplish what you are trying to do.
I'll think about it some more, but at the moment I'm pretty sure that there is no syntax to support that.

-Bob



On 4/26/2017 12:33 PM, Germán Biozzoli wrote:

Hi list

 

Sorry if it's a trivial question, but I can't find in SolrMarc documentation a way to concatenate two subfields into a Solr one with an specific separator.

 

I've tried

 

format = 337a,join(" / "),347b

 

But, as the documentation says, it will work only for one field, concatenating subfields, third argument is not recognoiced.

 

format = 337a:337b

 

It will create an entry for each subfield, if I understand correctly.

 

Is there an example of concatenating two subfields with an specific char?

 

Thanks a lot

German




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot




_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general

 



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Doubt about SolrMarc

Germán Biozzoli
Thank you very much you both.

Demian is right, the second example was bad, unfortunately I have to work with two subfields from different fields (337a and 347b). 
I will pre-process the MARC file using a local field with a concatenation.

2017-04-26 15:11 GMT-03:00 Robert Haschart <[hidden email]>:
Demian is right.  

If you want two subfields from the same MARC field, for instance 337,  it is easy, and you can do it like his example.
If you want a subfield from one field, and another subfield from a different field, then my previous answer applies.

-Bob



On 4/26/2017 2:06 PM, Demian Katz wrote:

The examples in the original email are inconsistent – one suggests that both subfields are in 337 while one shows 337a and 347b. If both subfields are in 337, can’t you do:

 

337[a-b], join (" / ")

 

?

 

If they’re in separate fields, though, I agree that there doesn’t appear to be a way to do this with the basic spec, though a custom method would probably be fairly easy to develop.

 

- Demian

 

From: Robert Haschart [[hidden email]]
Sent: Wednesday, April 26, 2017 1:45 PM
To: [hidden email]
Subject: Re: [VuFind-General] Doubt about SolrMarc

 

German

I'm the primary developer of SolrMarc, and I cannot think of a way to easily accomplish what you are trying to do.
I'll think about it some more, but at the moment I'm pretty sure that there is no syntax to support that.

-Bob



On 4/26/2017 12:33 PM, Germán Biozzoli wrote:

Hi list

 

Sorry if it's a trivial question, but I can't find in SolrMarc documentation a way to concatenate two subfields into a Solr one with an specific separator.

 

I've tried

 

format = 337a,join(" / "),347b

 

But, as the documentation says, it will work only for one field, concatenating subfields, third argument is not recognoiced.

 

format = 337a:337b

 

It will create an entry for each subfield, if I understand correctly.

 

Is there an example of concatenating two subfields with an specific char?

 

Thanks a lot

German




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot




_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general

 



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Doubt about SolrMarc

Demian Katz

Sounds like a good place to start – but perhaps we should open an issue for this for future reference; it certainly seems like something that might make sense as a core spec feature (though I don’t personally have a use case at this very moment).

 

- Demian

 

From: Germán Biozzoli [mailto:[hidden email]]
Sent: Wednesday, April 26, 2017 2:26 PM
To: Robert Haschart
Cc: Demian Katz; [hidden email]
Subject: Re: [VuFind-General] Doubt about SolrMarc

 

Thank you very much you both.

 

Demian is right, the second example was bad, unfortunately I have to work with two subfields from different fields (337a and 347b). 

I will pre-process the MARC file using a local field with a concatenation.

 

2017-04-26 15:11 GMT-03:00 Robert Haschart <[hidden email]>:

Demian is right.  

If you want two subfields from the same MARC field, for instance 337,  it is easy, and you can do it like his example.
If you want a subfield from one field, and another subfield from a different field, then my previous answer applies.

-Bob



On 4/26/2017 2:06 PM, Demian Katz wrote:

The examples in the original email are inconsistent – one suggests that both subfields are in 337 while one shows 337a and 347b. If both subfields are in 337, can’t you do:

 

337[a-b], join (" / ")

 

?

 

If they’re in separate fields, though, I agree that there doesn’t appear to be a way to do this with the basic spec, though a custom method would probably be fairly easy to develop.

 

- Demian

 

From: Robert Haschart [[hidden email]]
Sent: Wednesday, April 26, 2017 1:45 PM
To: [hidden email]
Subject: Re: [VuFind-General] Doubt about SolrMarc

 

German

I'm the primary developer of SolrMarc, and I cannot think of a way to easily accomplish what you are trying to do.
I'll think about it some more, but at the moment I'm pretty sure that there is no syntax to support that.

-Bob


On 4/26/2017 12:33 PM, Germán Biozzoli wrote:

Hi list

 

Sorry if it's a trivial question, but I can't find in SolrMarc documentation a way to concatenate two subfields into a Solr one with an specific separator.

 

I've tried

 

format = 337a,join(" / "),347b

 

But, as the documentation says, it will work only for one field, concatenating subfields, third argument is not recognoiced.

 

format = 337a:337b

 

It will create an entry for each subfield, if I understand correctly.

 

Is there an example of concatenating two subfields with an specific char?

 

Thanks a lot

German



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot



_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general

 

 


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general

 


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Doubt about SolrMarc

Robert Haschart
In reply to this post by Germán Biozzoli
German,

Can you define what should happen if there is:
  a 337a but no 347b, or vice versa,
 or  if there are more than one 337 field
 or more than one a subfield  a in a 337 field
 or  if there are more than one 347 field
 or more than one subfield b in a 347 field

It the expected result is     the first 337a / the first 347b    and all other occurrences are ignored since they are errors, it should be easy to implement

-Bob

On 4/26/2017 2:25 PM, Germán Biozzoli wrote:
Thank you very much you both.

Demian is right, the second example was bad, unfortunately I have to work with two subfields from different fields (337a and 347b). 
I will pre-process the MARC file using a local field with a concatenation.

2017-04-26 15:11 GMT-03:00 Robert Haschart <[hidden email]>:
Demian is right.  

If you want two subfields from the same MARC field, for instance 337,  it is easy, and you can do it like his example.
If you want a subfield from one field, and another subfield from a different field, then my previous answer applies.

-Bob



On 4/26/2017 2:06 PM, Demian Katz wrote:

The examples in the original email are inconsistent – one suggests that both subfields are in 337 while one shows 337a and 347b. If both subfields are in 337, can’t you do:

 

337[a-b], join (" / ")

 

?

 

If they’re in separate fields, though, I agree that there doesn’t appear to be a way to do this with the basic spec, though a custom method would probably be fairly easy to develop.

 

- Demian

 

From: Robert Haschart [[hidden email]]
Sent: Wednesday, April 26, 2017 1:45 PM
To: [hidden email]
Subject: Re: [VuFind-General] Doubt about SolrMarc

 

German

I'm the primary developer of SolrMarc, and I cannot think of a way to easily accomplish what you are trying to do.
I'll think about it some more, but at the moment I'm pretty sure that there is no syntax to support that.

-Bob



On 4/26/2017 12:33 PM, Germán Biozzoli wrote:

Hi list

 

Sorry if it's a trivial question, but I can't find in SolrMarc documentation a way to concatenate two subfields into a Solr one with an specific separator.

 

I've tried

 

format = 337a,join(" / "),347b

 

But, as the documentation says, it will work only for one field, concatenating subfields, third argument is not recognoiced.

 

format = 337a:337b

 

It will create an entry for each subfield, if I understand correctly.

 

Is there an example of concatenating two subfields with an specific char?

 

Thanks a lot

German




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general

 

------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ VuFind-General mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/vufind-general

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Doubt about SolrMarc

Demian Katz

Bob,

 

One other potential way to think about this might be “collect all of the matching values from the field spec into an array, and then implode the elements in the array to a single string using a provided delimiter string.” That might be the most flexible approach, since you could chain together other things to control whether the array contains first values, last values, etc., etc. Of course, you know the code better than I do, so maybe my idea is not so easy to implement as it seems in theory. J

 

- Demian

 

From: Robert Haschart [mailto:[hidden email]]
Sent: Wednesday, April 26, 2017 3:31 PM
To: Germán Biozzoli
Cc: Demian Katz; [hidden email]
Subject: Re: [VuFind-General] Doubt about SolrMarc

 

German,

Can you define what should happen if there is:
  a 337a but no 347b, or vice versa,
 or  if there are more than one 337 field
 or more than one a subfield  a in a 337 field
 or  if there are more than one 347 field
 or more than one subfield b in a 347 field

It the expected result is     the first 337a / the first 347b    and all other occurrences are ignored since they are errors, it should be easy to implement

-Bob

On 4/26/2017 2:25 PM, Germán Biozzoli wrote:

Thank you very much you both.

 

Demian is right, the second example was bad, unfortunately I have to work with two subfields from different fields (337a and 347b). 

I will pre-process the MARC file using a local field with a concatenation.

 

2017-04-26 15:11 GMT-03:00 Robert Haschart <[hidden email]>:

Demian is right.  

If you want two subfields from the same MARC field, for instance 337,  it is easy, and you can do it like his example.
If you want a subfield from one field, and another subfield from a different field, then my previous answer applies.

-Bob



On 4/26/2017 2:06 PM, Demian Katz wrote:

The examples in the original email are inconsistent – one suggests that both subfields are in 337 while one shows 337a and 347b. If both subfields are in 337, can’t you do:

 

337[a-b], join (" / ")

 

?

 

If they’re in separate fields, though, I agree that there doesn’t appear to be a way to do this with the basic spec, though a custom method would probably be fairly easy to develop.

 

- Demian

 

From: Robert Haschart [[hidden email]]
Sent: Wednesday, April 26, 2017 1:45 PM
To: [hidden email]
Subject: Re: [VuFind-General] Doubt about SolrMarc

 

German

I'm the primary developer of SolrMarc, and I cannot think of a way to easily accomplish what you are trying to do.
I'll think about it some more, but at the moment I'm pretty sure that there is no syntax to support that.

-Bob


On 4/26/2017 12:33 PM, Germán Biozzoli wrote:

Hi list

 

Sorry if it's a trivial question, but I can't find in SolrMarc documentation a way to concatenate two subfields into a Solr one with an specific separator.

 

I've tried

 

format = 337a,join(" / "),347b

 

But, as the documentation says, it will work only for one field, concatenating subfields, third argument is not recognoiced.

 

format = 337a:337b

 

It will create an entry for each subfield, if I understand correctly.

 

Is there an example of concatenating two subfields with an specific char?

 

Thanks a lot

German



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general

 

------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ VuFind-General mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/vufind-general


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Doubt about SolrMarc

Germán Biozzoli
Hi Demian & Bob

Yes, I assumed that 337 and 347 fields (same for subfields) are not repeteable for the time being, because I'm adding those fields in a previous conversion process. My idea was to join the first (and unique) occ of each one. 

I'm implementing an specific catalog for material that were processed to be accesible. Then I wanted to create a home facet showing the distribution of material nature (authorized term) / technology of the records that the catalog hosts

Textual / Adobe PDF [15 objects], 
Sound recording / MP3 [22 objects] 

and so on.

Thinking about the contributors to this catalog will tend to adopt those fields without any conversion, it does not seems like SolrMarc could help because it's a lot of logic to control the posible inconsistences. For the time being I've started creating only the facet for the technology that will be enough to demonstrate the idea :)

BTW, Demian, is there an "easy" way to add in home facet the number of objects as it's presented in the example?

Thanks again for taking the time to explore the idea
Kind Regards
German





2017-04-26 16:35 GMT-03:00 Demian Katz <[hidden email]>:

Bob,

 

One other potential way to think about this might be “collect all of the matching values from the field spec into an array, and then implode the elements in the array to a single string using a provided delimiter string.” That might be the most flexible approach, since you could chain together other things to control whether the array contains first values, last values, etc., etc. Of course, you know the code better than I do, so maybe my idea is not so easy to implement as it seems in theory. J

 

- Demian

 

From: Robert Haschart [mailto:[hidden email]]
Sent: Wednesday, April 26, 2017 3:31 PM
To: Germán Biozzoli
Cc: Demian Katz; [hidden email]


Subject: Re: [VuFind-General] Doubt about SolrMarc

 

German,

Can you define what should happen if there is:
  a 337a but no 347b, or vice versa,
 or  if there are more than one 337 field
 or more than one a subfield  a in a 337 field
 or  if there are more than one 347 field
 or more than one subfield b in a 347 field

It the expected result is     the first 337a / the first 347b    and all other occurrences are ignored since they are errors, it should be easy to implement

-Bob

On 4/26/2017 2:25 PM, Germán Biozzoli wrote:

Thank you very much you both.

 

Demian is right, the second example was bad, unfortunately I have to work with two subfields from different fields (337a and 347b). 

I will pre-process the MARC file using a local field with a concatenation.

 

2017-04-26 15:11 GMT-03:00 Robert Haschart <[hidden email]>:

Demian is right.  

If you want two subfields from the same MARC field, for instance 337,  it is easy, and you can do it like his example.
If you want a subfield from one field, and another subfield from a different field, then my previous answer applies.

-Bob



On 4/26/2017 2:06 PM, Demian Katz wrote:

The examples in the original email are inconsistent – one suggests that both subfields are in 337 while one shows 337a and 347b. If both subfields are in 337, can’t you do:

 

337[a-b], join (" / ")

 

?

 

If they’re in separate fields, though, I agree that there doesn’t appear to be a way to do this with the basic spec, though a custom method would probably be fairly easy to develop.

 

- Demian

 

From: Robert Haschart [[hidden email]]
Sent: Wednesday, April 26, 2017 1:45 PM
To: [hidden email]
Subject: Re: [VuFind-General] Doubt about SolrMarc

 

German

I'm the primary developer of SolrMarc, and I cannot think of a way to easily accomplish what you are trying to do.
I'll think about it some more, but at the moment I'm pretty sure that there is no syntax to support that.

-Bob


On 4/26/2017 12:33 PM, Germán Biozzoli wrote:

Hi list

 

Sorry if it's a trivial question, but I can't find in SolrMarc documentation a way to concatenate two subfields into a Solr one with an specific separator.

 

I've tried

 

format = 337a,join(" / "),347b

 

But, as the documentation says, it will work only for one field, concatenating subfields, third argument is not recognoiced.

 

format = 337a:337b

 

It will create an entry for each subfield, if I understand correctly.

 

Is there an example of concatenating two subfields with an specific char?

 

Thanks a lot

German



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general

 

------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ VuFind-General mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/vufind-general



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Doubt about SolrMarc

Demian Katz

Germán,

 

The home page facet list is processed by this view helper in order to put the values in alphabetical order:

 

https://github.com/vufind-org/vufind/blob/0e2371ef1d997747f99575f39868ce59d4360fbc/module/VuFind/src/VuFind/View/Helper/Root/SortFacetList.php#L41

The whole list is assembled and displayed by this template:

 

https://github.com/vufind-org/vufind/blob/master/themes/bootstrap3/templates/search/home.phtml

 

You have at least two options:

 

1.)    Modify the display template to display the facet data sorted by count, bypassing the sorting routine entirely; this should make it easy to display the counts.

2.)    Modify the sort helper so that it appends the count to the display label using some sort of delimiter. This should keep the sorting working correctly, but it will allow you to explode the value and assemble an appropriate display in the template.

 

Either way, you may also want to keep in mind the fact that VuFind caches the values used for the home page facets to prevent excessive load on the Solr server. By including the counts, you may make it even more obvious that this data is not always 100% fresh. That’s not necessarily a big problem – but you may want to make sure that your cache refreshes with some regularity (I can’t remember off the top of my head how long these values last by default).

 

Let me know if you have questions about any of this!

 

- Demian

 

 

From: Germán Biozzoli [mailto:[hidden email]]
Sent: Wednesday, April 26, 2017 5:54 PM
To: Demian Katz
Cc: Robert Haschart; [hidden email]
Subject: Re: [VuFind-General] Doubt about SolrMarc

 

Hi Demian & Bob

 

Yes, I assumed that 337 and 347 fields (same for subfields) are not repeteable for the time being, because I'm adding those fields in a previous conversion process. My idea was to join the first (and unique) occ of each one. 

 

I'm implementing an specific catalog for material that were processed to be accesible. Then I wanted to create a home facet showing the distribution of material nature (authorized term) / technology of the records that the catalog hosts

 

Textual / Adobe PDF [15 objects], 

Sound recording / MP3 [22 objects] 

 

and so on.

 

Thinking about the contributors to this catalog will tend to adopt those fields without any conversion, it does not seems like SolrMarc could help because it's a lot of logic to control the posible inconsistences. For the time being I've started creating only the facet for the technology that will be enough to demonstrate the idea :)

 

BTW, Demian, is there an "easy" way to add in home facet the number of objects as it's presented in the example?

 

Thanks again for taking the time to explore the idea

Kind Regards

German

 

 

 

 

 

2017-04-26 16:35 GMT-03:00 Demian Katz <[hidden email]>:

Bob,

 

One other potential way to think about this might be “collect all of the matching values from the field spec into an array, and then implode the elements in the array to a single string using a provided delimiter string.” That might be the most flexible approach, since you could chain together other things to control whether the array contains first values, last values, etc., etc. Of course, you know the code better than I do, so maybe my idea is not so easy to implement as it seems in theory. J

 

- Demian

 

From: Robert Haschart [mailto:[hidden email]]
Sent: Wednesday, April 26, 2017 3:31 PM
To: Germán Biozzoli
Cc: Demian Katz; [hidden email]


Subject: Re: [VuFind-General] Doubt about SolrMarc

 

German,

Can you define what should happen if there is:
  a 337a but no 347b, or vice versa,
 or  if there are more than one 337 field
 or more than one a subfield  a in a 337 field
 or  if there are more than one 347 field
 or more than one subfield b in a 347 field

It the expected result is     the first 337a / the first 347b    and all other occurrences are ignored since they are errors, it should be easy to implement

-Bob

On 4/26/2017 2:25 PM, Germán Biozzoli wrote:

Thank you very much you both.

 

Demian is right, the second example was bad, unfortunately I have to work with two subfields from different fields (337a and 347b). 

I will pre-process the MARC file using a local field with a concatenation.

 

2017-04-26 15:11 GMT-03:00 Robert Haschart <[hidden email]>:

Demian is right.  

If you want two subfields from the same MARC field, for instance 337,  it is easy, and you can do it like his example.
If you want a subfield from one field, and another subfield from a different field, then my previous answer applies.

-Bob

 

On 4/26/2017 2:06 PM, Demian Katz wrote:

The examples in the original email are inconsistent – one suggests that both subfields are in 337 while one shows 337a and 347b. If both subfields are in 337, can’t you do:

 

337[a-b], join (" / ")

 

?

 

If they’re in separate fields, though, I agree that there doesn’t appear to be a way to do this with the basic spec, though a custom method would probably be fairly easy to develop.

 

- Demian

 

From: Robert Haschart [[hidden email]]
Sent: Wednesday, April 26, 2017 1:45 PM
To: [hidden email]
Subject: Re: [VuFind-General] Doubt about SolrMarc

 

German

I'm the primary developer of SolrMarc, and I cannot think of a way to easily accomplish what you are trying to do.
I'll think about it some more, but at the moment I'm pretty sure that there is no syntax to support that.

-Bob

On 4/26/2017 12:33 PM, Germán Biozzoli wrote:

Hi list

 

Sorry if it's a trivial question, but I can't find in SolrMarc documentation a way to concatenate two subfields into a Solr one with an specific separator.

 

I've tried

 

format = 337a,join(" / "),347b

 

But, as the documentation says, it will work only for one field, concatenating subfields, third argument is not recognoiced.

 

format = 337a:337b

 

It will create an entry for each subfield, if I understand correctly.

 

Is there an example of concatenating two subfields with an specific char?

 

Thanks a lot

German

 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general

 

------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ VuFind-General mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/vufind-general

 


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Doubt about SolrMarc

Robert Haschart
In reply to this post by Germán Biozzoli

German,

I tried sending this a couple of times, but my university's mail system "helpfully" blocked the message, because I attached scary looking java source code.

I have written two new custom indexing routines :  getSimpleJoinedFields  and getComplexJoinedFields
They are implemented in the attached java source file.  (Assuming my mail program doesn't strip it out)

Place that source file in  the  index_java/src  directory (rename it to remove the ".txt" suffix)  and add something like the following to your index specification:

my_field = custom, getSimpleJoinedFields("337a", "347b", " / ")
my_other_field = custom, getComplexJoinedFields("337a,clean", "347b,clean", " / ")

the first method accepts a single field tag, followed by one (or more) subfield tags for the first two parameters, and a literal string for the third.

the second method works similarly, but the first two parameters can be given a full solrmarc specification, including modifiers like "clean"

One or the other should be able to do what you want.

-Bob Haschart


On 4/26/2017 5:54 PM, Germán Biozzoli wrote:
Hi Demian & Bob

Yes, I assumed that 337 and 347 fields (same for subfields) are not repeteable for the time being, because I'm adding those fields in a previous conversion process. My idea was to join the first (and unique) occ of each one. 

I'm implementing an specific catalog for material that were processed to be accesible. Then I wanted to create a home facet showing the distribution of material nature (authorized term) / technology of the records that the catalog hosts

Textual / Adobe PDF [15 objects], 
Sound recording / MP3 [22 objects] 

and so on.

Thinking about the contributors to this catalog will tend to adopt those fields without any conversion, it does not seems like SolrMarc could help because it's a lot of logic to control the posible inconsistences. For the time being I've started creating only the facet for the technology that will be enough to demonstrate the idea :)

BTW, Demian, is there an "easy" way to add in home facet the number of objects as it's presented in the example?

Thanks again for taking the time to explore the idea
Kind Regards
German





2017-04-26 16:35 GMT-03:00 Demian Katz <[hidden email]>:

Bob,

 

One other potential way to think about this might be “collect all of the matching values from the field spec into an array, and then implode the elements in the array to a single string using a provided delimiter string.” That might be the most flexible approach, since you could chain together other things to control whether the array contains first values, last values, etc., etc. Of course, you know the code better than I do, so maybe my idea is not so easy to implement as it seems in theory. J

 

- Demian

 

From: Robert Haschart [mailto:[hidden email]]
Sent: Wednesday, April 26, 2017 3:31 PM
To: Germán Biozzoli
Cc: Demian Katz; [hidden email]


Subject: Re: [VuFind-General] Doubt about SolrMarc

 

German,

Can you define what should happen if there is:
  a 337a but no 347b, or vice versa,
 or  if there are more than one 337 field
 or more than one a subfield  a in a 337 field
 or  if there are more than one 347 field
 or more than one subfield b in a 347 field

It the expected result is     the first 337a / the first 347b    and all other occurrences are ignored since they are errors, it should be easy to implement

-Bob

On 4/26/2017 2:25 PM, Germán Biozzoli wrote:

Thank you very much you both.

 

Demian is right, the second example was bad, unfortunately I have to work with two subfields from different fields (337a and 347b). 

I will pre-process the MARC file using a local field with a concatenation.

 

2017-04-26 15:11 GMT-03:00 Robert Haschart <[hidden email]>:

Demian is right.  

If you want two subfields from the same MARC field, for instance 337,  it is easy, and you can do it like his example.
If you want a subfield from one field, and another subfield from a different field, then my previous answer applies.

-Bob



On 4/26/2017 2:06 PM, Demian Katz wrote:

The examples in the original email are inconsistent – one suggests that both subfields are in 337 while one shows 337a and 347b. If both subfields are in 337, can’t you do:

 

337[a-b], join (" / ")

 

?

 

If they’re in separate fields, though, I agree that there doesn’t appear to be a way to do this with the basic spec, though a custom method would probably be fairly easy to develop.

 

- Demian

 

From: Robert Haschart [[hidden email]]
Sent: Wednesday, April 26, 2017 1:45 PM
To: [hidden email]
Subject: Re: [VuFind-General] Doubt about SolrMarc

 

German

I'm the primary developer of SolrMarc, and I cannot think of a way to easily accomplish what you are trying to do.
I'll think about it some more, but at the moment I'm pretty sure that there is no syntax to support that.

-Bob


On 4/26/2017 12:33 PM, Germán Biozzoli wrote:

Hi list

 

Sorry if it's a trivial question, but I can't find in SolrMarc documentation a way to concatenate two subfields into a Solr one with an specific separator.

 

I've tried

 

format = 337a,join(" / "),347b

 

But, as the documentation says, it will work only for one field, concatenating subfields, third argument is not recognoiced.

 

format = 337a:337b

 

It will create an entry for each subfield, if I understand correctly.

 

Is there an example of concatenating two subfields with an specific char?

 

Thanks a lot

German



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general

 

------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ VuFind-General mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/vufind-general


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general

JoinFieldsMixin.java.txt (5K) Download Attachment
Loading...